SlideShare a Scribd company logo
1 of 54
Application Architecture

Lars-Erik Kindblad
Senior Consultant
Blog: kindblad.com
Poor Architecture


                         Project Progress
Features Delivered




                                Time




                                            | Sector, Alliance, Offering
Good Architecture


                         Project Progress
Features Delivered




                                Time




                                            | Sector, Alliance, Offering
Foundation For Delivering Good Architecture

       Good communication with the business stakeholders
    •    Meet the needs of the business
       Understand the business processes
    •    Scale with the business
       Experience
    •    Simplify




                                                            | Sector, Alliance, Offering
Some Important Concepts & Principles


   Layered Architecture
   Maintainable code
   Testable code




                                                    | Sector, Alliance, Offering
LAYERED ARCHITECTURE

                       | Sector, Alliance, Offering
Logical Layers and Physical Tiers
 A Logically Layer is how you logically divide the code in the
  application
 A Physical Tier is how you divide your application into multiple sub-
  applications that can run on separate servers




                                                             | Sector, Alliance, Offering
LOGICAL LAYER ARCHITECTURE

                             | Sector, Alliance, Offering
3-Layer Architecture




                       | Sector, Alliance, Offering
Presentation Layer
 Also known as Frontend Layer, User Interface (UI) Layer

 Responsible for creating and displaying the user interface and
  handling user interaction
 Data shown is fetched from the Domain Layer




                                                            | Sector, Alliance, Offering
Service Layer
 Also known as Web Service Layer

 Responsible for exposing a web service API and returning the
  method result as XML or JSON
 Data returned is retrieved from the Domain Layer




                                                          | Sector, Alliance, Offering
Domain Layer
 Also known as Business Layer

 Responsible for all the business logic in the application
 Consists of a Domain Model and Domain Services




                                                              | Sector, Alliance, Offering
Domain Model
 Also known as Business Model, Business Objects, Entities etc.

 Responsible for having a model that reflects how the business
  stakeholders look at the world
 Consists of entities with relationships and behavior
 Similar to a database model but a domain model is richer




                                                          | Sector, Alliance, Offering
Domain Service
 Also known as Business Services, Business Managers etc.

 Business logic that does not belong within an entity




                                                         | Sector, Alliance, Offering
Infrastructure Layer
 Also known as Data Access Layer, Repository Layer etc.

 Responsible for querying a database, calling a web service, sending
  e-mail etc.




                                                           | Sector, Alliance, Offering
Example

 We want to create a banking application with customers and related
  accounts. An account consist of an account number, a balance and
  a credit limit.
  If the account has been overdrawn then the account and customer is
  considered to be “sick”, otherwise “healthy”

 Use Case 1: As a user I want to see if a customer is healthy or sick
 Use Case 2: As a user I want to retrieve if a customer is healthy or
  sick through a web service

 Technology: .NET, ASP.NET MVC, WCF

                                                            | Sector, Alliance, Offering
What do we need?

1. Domain Model for Customer and Account
2. Business logic for deciding if an account and customer is healthy or
   sick
3. 2 Classes: Fetching Customer and fetch list of Accounts from the
   database
4. Service Class for building up a Customer Entity with Accounts
Use Case 1:
1. MVC Controller and a View to display the health status for a given
   customer
Use Case 2:
1. WCF Service for returning whether a customer is healthy or not
                                                            | Sector, Alliance, Offering
Domain Model




               | Sector, Alliance, Offering
Domain Model




               | Sector, Alliance, Offering
Progress




           | Sector, Alliance, Offering
Infrastructure – Fetch Customer




                                  | Sector, Alliance, Offering
Infrastructure – Fetch Accounts




                                  | Sector, Alliance, Offering
Progress




           | Sector, Alliance, Offering
Domain Service – Build a Complete Customer




                                             | Sector, Alliance, Offering
Progress




           | Sector, Alliance, Offering
Use Case 1: Show the result to the user




                                          | Sector, Alliance, Offering
Progress




           | Sector, Alliance, Offering
Use Case 2: Return the result through a Web Service




                                               | Sector, Alliance, Offering
Completed




            | Sector, Alliance, Offering
Visual Studio Project Structure




                                  | Sector, Alliance, Offering
Why should you have many layers?

   Less code per layer
   Reduced complexity
   Easier to maintain code
   Easier to add new functionality
   Easier to test
   Allows for reuse code across the application




                                                   | Sector, Alliance, Offering
PHYSICAL TIER ARCHITECTURE

                             | Sector, Alliance, Offering
2-Tier Windows Client Architecture




                                     | Sector, Alliance, Offering
3-Tier Windows Client Architecture




                                     | Sector, Alliance, Offering
3-Tier Web Architecture




                          | Sector, Alliance, Offering
4-Tier Architecture




                      | Sector, Alliance, Offering
Why have many tiers?
 Reuse logic across applications
 Improve security, e.g. restrict database access for the client by going
  through a service
 Improved performance, the performance critical tiers can be scaled
  across multiple servers




                                                              | Sector, Alliance, Offering
MAINTAINABLE CODE

                    | Sector, Alliance, Offering
Maintainable Code

 Important to write code that is easy to maintain – Many enterprise
  systems can be around for decades




                                                            | Sector, Alliance, Offering
Follow a Coding Standard

 The Team should decide on, write down and follow a strict coding
  standard
 Be consistent on how you name classes, methods, variables etc.
 Be consistent on what architectural patterns to use, when to use it
  and how to structure the code
 = Cleaner code, easier to read and maintain




                                                            | Sector, Alliance, Offering
Single Responsibility Principle (SRP)

 A Class should only have 1 responsibility
  • Preferably only one public method
  • Small in size, preferably no longer than 1 screen size
 = Easier to:
  •   Read
  •   Maintain
  •   Change
  •   Test




                                                             | Sector, Alliance, Offering
A Typical Class




 5 responsibilities, 4 too many…




                                           | Sector, Alliance, Offering
… Converted into 5 Classes with 1 Responsibility Each




                                                | Sector, Alliance, Offering
TESTABLE CODE

                | Sector, Alliance, Offering
2 Main Types of Testing

 Integration Testing
  • Top to bottom testing




 Unit Testing
  • Test a single class without it’s dependencies using Inversion of Control




                                                                        | Sector, Alliance, Offering
Inversion of Control

   Inversion of Control = IOC
   Make code loosely coupled
   Make unit testing possible
   How? Move creation of dependencies outside the class they are
    being used in




 A better name - Inversion of Dependency Creation



                                                           | Sector, Alliance, Offering
Traditional Code




Inversion of Control using Dependency Injection




                                                  | Sector, Alliance, Offering
Traditional Code




Inversion of Control Code




                            | Sector, Alliance, Offering
Traditional Code




                   | Sector, Alliance, Offering
Inversion of Control using Dependency Injection




                                             | Sector, Alliance, Offering
Inversion of Control Container

 A framework that can automatically create a given type with all the
  required dependencies
 Popular frameworks for .NET
  •   Unity
  •   Castle Windsor
  •   Ninject
  •   StructureMap
  •   etc.




                                                            | Sector, Alliance, Offering
Inversion of Control Container

         Manual approach




      Using an IOC Container




                                 | Sector, Alliance, Offering
QUESTIONS?

             | Sector, Alliance, Offering
www.capgemini.com



The information contained in this presentation is proprietary. ©2010 Capgemini. All rights reserved

More Related Content

What's hot

Vfm corporate presentation v1
Vfm corporate presentation v1Vfm corporate presentation v1
Vfm corporate presentation v1
vfmindia
 
Vfm website-projects
Vfm website-projectsVfm website-projects
Vfm website-projects
vfmindia
 
Effective Application Development with WebSphere Message Broker
Effective Application Development with WebSphere Message BrokerEffective Application Development with WebSphere Message Broker
Effective Application Development with WebSphere Message Broker
Ant Phillips
 
Cs 1023 lec 12 soa (week 4)
Cs 1023 lec 12 soa (week 4)Cs 1023 lec 12 soa (week 4)
Cs 1023 lec 12 soa (week 4)
stanbridge
 

What's hot (20)

Scaling Integration
Scaling IntegrationScaling Integration
Scaling Integration
 
Vfm corporate presentation v1
Vfm corporate presentation v1Vfm corporate presentation v1
Vfm corporate presentation v1
 
OMG CORBA Component Model tutorial
OMG CORBA Component Model tutorialOMG CORBA Component Model tutorial
OMG CORBA Component Model tutorial
 
The Business Case behind Cloud Computing - The risks and rewards
The Business Case behind Cloud Computing - The risks and rewardsThe Business Case behind Cloud Computing - The risks and rewards
The Business Case behind Cloud Computing - The risks and rewards
 
Vfm website-projects
Vfm website-projectsVfm website-projects
Vfm website-projects
 
The evolving story for Agile Integration Architecture in 2019
The evolving story for Agile Integration Architecture in 2019The evolving story for Agile Integration Architecture in 2019
The evolving story for Agile Integration Architecture in 2019
 
AXCIOMA, the component framework for distributed, real-time and embedded systems
AXCIOMA, the component framework for distributed, real-time and embedded systemsAXCIOMA, the component framework for distributed, real-time and embedded systems
AXCIOMA, the component framework for distributed, real-time and embedded systems
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
ITI005En-SOA (II)
ITI005En-SOA (II)ITI005En-SOA (II)
ITI005En-SOA (II)
 
SOA Service Reusability for iWay SM
SOA Service Reusability for iWay SMSOA Service Reusability for iWay SM
SOA Service Reusability for iWay SM
 
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
A Model-Based Approach for Extracting Business Rules out of Legacy Informatio...
 
Implementing zero trust in IBM Cloud Pak for Integration
Implementing zero trust in IBM Cloud Pak for IntegrationImplementing zero trust in IBM Cloud Pak for Integration
Implementing zero trust in IBM Cloud Pak for Integration
 
Federated Machine Learning Framework
Federated Machine Learning FrameworkFederated Machine Learning Framework
Federated Machine Learning Framework
 
Cloud native integration
Cloud native integrationCloud native integration
Cloud native integration
 
Effective Application Development with WebSphere Message Broker
Effective Application Development with WebSphere Message BrokerEffective Application Development with WebSphere Message Broker
Effective Application Development with WebSphere Message Broker
 
Building enterprise depth APIs with the IBM hybrid integration portfolio
Building enterprise depth APIs with the IBM hybrid integration portfolioBuilding enterprise depth APIs with the IBM hybrid integration portfolio
Building enterprise depth APIs with the IBM hybrid integration portfolio
 
Canonical data model
Canonical data modelCanonical data model
Canonical data model
 
Cs 1023 lec 12 soa (week 4)
Cs 1023 lec 12 soa (week 4)Cs 1023 lec 12 soa (week 4)
Cs 1023 lec 12 soa (week 4)
 
Agile Integration Architecture: A Containerized and Decentralized Approach to...
Agile Integration Architecture: A Containerized and Decentralized Approach to...Agile Integration Architecture: A Containerized and Decentralized Approach to...
Agile Integration Architecture: A Containerized and Decentralized Approach to...
 
Resume1
Resume1Resume1
Resume1
 

Viewers also liked

Anforderungsanalyse und UML Grundlagen
Anforderungsanalyse und UML GrundlagenAnforderungsanalyse und UML Grundlagen
Anforderungsanalyse und UML Grundlagen
Christian Baranowski
 
Roadmap von Microsoft UI Technologien und Windows 8
Roadmap von Microsoft UI Technologien und Windows 8Roadmap von Microsoft UI Technologien und Windows 8
Roadmap von Microsoft UI Technologien und Windows 8
chmoser79
 

Viewers also liked (20)

Application Architecture
Application ArchitectureApplication Architecture
Application Architecture
 
Publish & Subscribe to events using an Event Aggregator
Publish & Subscribe to events using an Event AggregatorPublish & Subscribe to events using an Event Aggregator
Publish & Subscribe to events using an Event Aggregator
 
Application Layer in PHP
Application Layer in PHPApplication Layer in PHP
Application Layer in PHP
 
Responsive Design - Quick & Dirty
Responsive Design - Quick & DirtyResponsive Design - Quick & Dirty
Responsive Design - Quick & Dirty
 
Ready or not: No UI vom Verschwinden des Graphical User Interfaces
Ready or not: No UI vom Verschwinden des Graphical User InterfacesReady or not: No UI vom Verschwinden des Graphical User Interfaces
Ready or not: No UI vom Verschwinden des Graphical User Interfaces
 
Webinar: Responsive Design
Webinar: Responsive DesignWebinar: Responsive Design
Webinar: Responsive Design
 
Unit Tests are Overrated (NDCOslo 2013)
Unit Tests are Overrated (NDCOslo 2013)Unit Tests are Overrated (NDCOslo 2013)
Unit Tests are Overrated (NDCOslo 2013)
 
Avoid code duplication! Principles & Patterns
Avoid code duplication! Principles & PatternsAvoid code duplication! Principles & Patterns
Avoid code duplication! Principles & Patterns
 
Systementwurf mit UML
Systementwurf mit UMLSystementwurf mit UML
Systementwurf mit UML
 
How to build more reliable, robust and scalable distributed systems
How to build more reliable, robust and scalable distributed systemsHow to build more reliable, robust and scalable distributed systems
How to build more reliable, robust and scalable distributed systems
 
Anforderungsanalyse und UML Grundlagen
Anforderungsanalyse und UML GrundlagenAnforderungsanalyse und UML Grundlagen
Anforderungsanalyse und UML Grundlagen
 
Domain Driven Design und Nosql
Domain Driven Design und Nosql Domain Driven Design und Nosql
Domain Driven Design und Nosql
 
Mobile Patterns - Wie Apps und Co. digitale Interfaces revolutionieren
Mobile Patterns - Wie Apps und Co. digitale Interfaces revolutionierenMobile Patterns - Wie Apps und Co. digitale Interfaces revolutionieren
Mobile Patterns - Wie Apps und Co. digitale Interfaces revolutionieren
 
The Single Responsibility Principle
The Single Responsibility PrincipleThe Single Responsibility Principle
The Single Responsibility Principle
 
Roadmap von Microsoft UI Technologien und Windows 8
Roadmap von Microsoft UI Technologien und Windows 8Roadmap von Microsoft UI Technologien und Windows 8
Roadmap von Microsoft UI Technologien und Windows 8
 
Domain-driven design - eine Einführung
Domain-driven design - eine EinführungDomain-driven design - eine Einführung
Domain-driven design - eine Einführung
 
SwissICT Fachgruppe UX: Definition und Bedeutung von User Experience
SwissICT Fachgruppe UX: Definition und Bedeutung von User ExperienceSwissICT Fachgruppe UX: Definition und Bedeutung von User Experience
SwissICT Fachgruppe UX: Definition und Bedeutung von User Experience
 
Beyond GUI - Die Zukunft digitaler Interfaces
Beyond GUI - Die Zukunft digitaler InterfacesBeyond GUI - Die Zukunft digitaler Interfaces
Beyond GUI - Die Zukunft digitaler Interfaces
 
Message Oriented Architecture using NServiceBus
Message Oriented Architecture using NServiceBusMessage Oriented Architecture using NServiceBus
Message Oriented Architecture using NServiceBus
 
Sci-Fi Interfaces - Innovationsmotor für Mensch-Maschine-Interfaces?
Sci-Fi Interfaces - Innovationsmotor für Mensch-Maschine-Interfaces?Sci-Fi Interfaces - Innovationsmotor für Mensch-Maschine-Interfaces?
Sci-Fi Interfaces - Innovationsmotor für Mensch-Maschine-Interfaces?
 

Similar to Application Architecture by Lars-Erik Kindblad, Capgemini

Sa 004 quality_attributes
Sa 004 quality_attributesSa 004 quality_attributes
Sa 004 quality_attributes
Frank Gielen
 
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
Daniel Berg
 

Similar to Application Architecture by Lars-Erik Kindblad, Capgemini (20)

Layered Software Architecture
Layered Software ArchitectureLayered Software Architecture
Layered Software Architecture
 
#ATAGTR2020 Presentation - Microservices – Explored
#ATAGTR2020 Presentation - Microservices – Explored#ATAGTR2020 Presentation - Microservices – Explored
#ATAGTR2020 Presentation - Microservices – Explored
 
Newt global meetup microservices
Newt global meetup microservicesNewt global meetup microservices
Newt global meetup microservices
 
Automating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupAutomating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native Meetup
 
Notes from the Field - Cloud Solutions with VMware vCloud Director
Notes from the Field - Cloud Solutions with VMware vCloud DirectorNotes from the Field - Cloud Solutions with VMware vCloud Director
Notes from the Field - Cloud Solutions with VMware vCloud Director
 
Sa 004 quality_attributes
Sa 004 quality_attributesSa 004 quality_attributes
Sa 004 quality_attributes
 
Fallsem2021 22 ita2012-eth_vl2021220101938_reference_material_i_06-aug-2021_m...
Fallsem2021 22 ita2012-eth_vl2021220101938_reference_material_i_06-aug-2021_m...Fallsem2021 22 ita2012-eth_vl2021220101938_reference_material_i_06-aug-2021_m...
Fallsem2021 22 ita2012-eth_vl2021220101938_reference_material_i_06-aug-2021_m...
 
Discussion About Microservices Architecture
Discussion About Microservices ArchitectureDiscussion About Microservices Architecture
Discussion About Microservices Architecture
 
Open day competenze digitali boverino v-mware intro
Open day competenze digitali   boverino v-mware introOpen day competenze digitali   boverino v-mware intro
Open day competenze digitali boverino v-mware intro
 
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
 
Managed Services Overview
Managed Services OverviewManaged Services Overview
Managed Services Overview
 
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
 
Microsoft Dynamics
Microsoft DynamicsMicrosoft Dynamics
Microsoft Dynamics
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
 
The elegant way of implementing microservices with istio
The elegant way of implementing microservices with istioThe elegant way of implementing microservices with istio
The elegant way of implementing microservices with istio
 
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
 
Oracle Cloud Reference Architecture
Oracle Cloud Reference ArchitectureOracle Cloud Reference Architecture
Oracle Cloud Reference Architecture
 
Creating your Hybrid Cloud with AWS -Technical 201
Creating your Hybrid Cloud with AWS -Technical 201Creating your Hybrid Cloud with AWS -Technical 201
Creating your Hybrid Cloud with AWS -Technical 201
 
End to-End Monitoring for ITSM and DevOps
End to-End Monitoring for ITSM and DevOpsEnd to-End Monitoring for ITSM and DevOps
End to-End Monitoring for ITSM and DevOps
 
Best Practices for Partnering with AWS
Best Practices for Partnering with AWSBest Practices for Partnering with AWS
Best Practices for Partnering with AWS
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Application Architecture by Lars-Erik Kindblad, Capgemini

  • 2. Poor Architecture Project Progress Features Delivered Time | Sector, Alliance, Offering
  • 3. Good Architecture Project Progress Features Delivered Time | Sector, Alliance, Offering
  • 4. Foundation For Delivering Good Architecture  Good communication with the business stakeholders • Meet the needs of the business  Understand the business processes • Scale with the business  Experience • Simplify | Sector, Alliance, Offering
  • 5. Some Important Concepts & Principles  Layered Architecture  Maintainable code  Testable code | Sector, Alliance, Offering
  • 6. LAYERED ARCHITECTURE | Sector, Alliance, Offering
  • 7. Logical Layers and Physical Tiers  A Logically Layer is how you logically divide the code in the application  A Physical Tier is how you divide your application into multiple sub- applications that can run on separate servers | Sector, Alliance, Offering
  • 8. LOGICAL LAYER ARCHITECTURE | Sector, Alliance, Offering
  • 9. 3-Layer Architecture | Sector, Alliance, Offering
  • 10. Presentation Layer  Also known as Frontend Layer, User Interface (UI) Layer  Responsible for creating and displaying the user interface and handling user interaction  Data shown is fetched from the Domain Layer | Sector, Alliance, Offering
  • 11. Service Layer  Also known as Web Service Layer  Responsible for exposing a web service API and returning the method result as XML or JSON  Data returned is retrieved from the Domain Layer | Sector, Alliance, Offering
  • 12. Domain Layer  Also known as Business Layer  Responsible for all the business logic in the application  Consists of a Domain Model and Domain Services | Sector, Alliance, Offering
  • 13. Domain Model  Also known as Business Model, Business Objects, Entities etc.  Responsible for having a model that reflects how the business stakeholders look at the world  Consists of entities with relationships and behavior  Similar to a database model but a domain model is richer | Sector, Alliance, Offering
  • 14. Domain Service  Also known as Business Services, Business Managers etc.  Business logic that does not belong within an entity | Sector, Alliance, Offering
  • 15. Infrastructure Layer  Also known as Data Access Layer, Repository Layer etc.  Responsible for querying a database, calling a web service, sending e-mail etc. | Sector, Alliance, Offering
  • 16. Example  We want to create a banking application with customers and related accounts. An account consist of an account number, a balance and a credit limit. If the account has been overdrawn then the account and customer is considered to be “sick”, otherwise “healthy”  Use Case 1: As a user I want to see if a customer is healthy or sick  Use Case 2: As a user I want to retrieve if a customer is healthy or sick through a web service  Technology: .NET, ASP.NET MVC, WCF | Sector, Alliance, Offering
  • 17. What do we need? 1. Domain Model for Customer and Account 2. Business logic for deciding if an account and customer is healthy or sick 3. 2 Classes: Fetching Customer and fetch list of Accounts from the database 4. Service Class for building up a Customer Entity with Accounts Use Case 1: 1. MVC Controller and a View to display the health status for a given customer Use Case 2: 1. WCF Service for returning whether a customer is healthy or not | Sector, Alliance, Offering
  • 18. Domain Model | Sector, Alliance, Offering
  • 19. Domain Model | Sector, Alliance, Offering
  • 20. Progress | Sector, Alliance, Offering
  • 21. Infrastructure – Fetch Customer | Sector, Alliance, Offering
  • 22. Infrastructure – Fetch Accounts | Sector, Alliance, Offering
  • 23. Progress | Sector, Alliance, Offering
  • 24. Domain Service – Build a Complete Customer | Sector, Alliance, Offering
  • 25. Progress | Sector, Alliance, Offering
  • 26. Use Case 1: Show the result to the user | Sector, Alliance, Offering
  • 27. Progress | Sector, Alliance, Offering
  • 28. Use Case 2: Return the result through a Web Service | Sector, Alliance, Offering
  • 29. Completed | Sector, Alliance, Offering
  • 30. Visual Studio Project Structure | Sector, Alliance, Offering
  • 31. Why should you have many layers?  Less code per layer  Reduced complexity  Easier to maintain code  Easier to add new functionality  Easier to test  Allows for reuse code across the application | Sector, Alliance, Offering
  • 32. PHYSICAL TIER ARCHITECTURE | Sector, Alliance, Offering
  • 33. 2-Tier Windows Client Architecture | Sector, Alliance, Offering
  • 34. 3-Tier Windows Client Architecture | Sector, Alliance, Offering
  • 35. 3-Tier Web Architecture | Sector, Alliance, Offering
  • 36. 4-Tier Architecture | Sector, Alliance, Offering
  • 37. Why have many tiers?  Reuse logic across applications  Improve security, e.g. restrict database access for the client by going through a service  Improved performance, the performance critical tiers can be scaled across multiple servers | Sector, Alliance, Offering
  • 38. MAINTAINABLE CODE | Sector, Alliance, Offering
  • 39. Maintainable Code  Important to write code that is easy to maintain – Many enterprise systems can be around for decades | Sector, Alliance, Offering
  • 40. Follow a Coding Standard  The Team should decide on, write down and follow a strict coding standard  Be consistent on how you name classes, methods, variables etc.  Be consistent on what architectural patterns to use, when to use it and how to structure the code  = Cleaner code, easier to read and maintain | Sector, Alliance, Offering
  • 41. Single Responsibility Principle (SRP)  A Class should only have 1 responsibility • Preferably only one public method • Small in size, preferably no longer than 1 screen size  = Easier to: • Read • Maintain • Change • Test | Sector, Alliance, Offering
  • 42. A Typical Class  5 responsibilities, 4 too many… | Sector, Alliance, Offering
  • 43. … Converted into 5 Classes with 1 Responsibility Each | Sector, Alliance, Offering
  • 44. TESTABLE CODE | Sector, Alliance, Offering
  • 45. 2 Main Types of Testing  Integration Testing • Top to bottom testing  Unit Testing • Test a single class without it’s dependencies using Inversion of Control | Sector, Alliance, Offering
  • 46. Inversion of Control  Inversion of Control = IOC  Make code loosely coupled  Make unit testing possible  How? Move creation of dependencies outside the class they are being used in  A better name - Inversion of Dependency Creation | Sector, Alliance, Offering
  • 47. Traditional Code Inversion of Control using Dependency Injection | Sector, Alliance, Offering
  • 48. Traditional Code Inversion of Control Code | Sector, Alliance, Offering
  • 49. Traditional Code | Sector, Alliance, Offering
  • 50. Inversion of Control using Dependency Injection | Sector, Alliance, Offering
  • 51. Inversion of Control Container  A framework that can automatically create a given type with all the required dependencies  Popular frameworks for .NET • Unity • Castle Windsor • Ninject • StructureMap • etc. | Sector, Alliance, Offering
  • 52. Inversion of Control Container Manual approach Using an IOC Container | Sector, Alliance, Offering
  • 53. QUESTIONS? | Sector, Alliance, Offering
  • 54. www.capgemini.com The information contained in this presentation is proprietary. ©2010 Capgemini. All rights reserved