SlideShare uma empresa Scribd logo
1 de 16
Domain Driven
Design
What it is and what it is not?
•   "Domain" not like in "part of the URL", but like in "area of business
    expertise"
•   Wikipedia: (http://en.wikipedia.org/wiki/Domain-driven_design)
    Domain-driven design (DDD) is an approach to developing software for
    complex needs by deeply connecting the implementation to an
    evolving model of the core business concepts. The premise of domain-
    driven design is the following:
     o Placing the project's primary focus on the core domain and domain
         logic
     o Basing complex designs on a model
     o Initiating a creative collaboration between technical and domain
         experts to iteratively cut ever closer to the conceptual heart of the
         problem.
     o Domain-driven design is not a technology or a methodology.
    DDD provides a structure of practices and terminology for making
    design decisions that focus and accelerate software projects dealing with
    complicated domains.
Core definitions
Domain: A sphere of knowledge (ontology), influence, or activity. The subject

•
  area to which the user applies a program is the domain of the software.
    Model: A system of abstractions that describes selected aspects of a

•
    domain and can be used to solve problems related to that domain.
    Ubiquitous Language: A language structured around the domain model
    and used by all team members to connect all the activities of the team

•
    with the software.
    Context: The setting in which a word or statement appears that
    determines its meaning.
Building blocks of the model
In DDD, there are artifacts to express, create, and retrieve domain models:
 •   Entity: An object that is not defined by its attributes, but rather by a thread of
     continuity and its identity.
 •   Value Object: An object that contains attributes but has no conceptual identity.
     They should be treated as immutable.
 •   Aggregate: A collection of objects that are bound together by a root
     entity, otherwise known as an aggregate root. The aggregate root guarantees the
     consistency of changes being made within the aggregate by forbidding external
     objects from holding references to its members.
 •   Service: When an operation does not conceptually belong to any object.
     Following the natural contours of the problem, you can implement these operations
     in services.
 •   Repository: methods for retrieving domain objects should delegate to a
     specialized Repository object such that alternative storage implementations may be
     easily interchanged.
 •   Factory: methods for creating domain objects should delegate to a specialized
     Factory object such that alternative implementations may be easily interchanged.
Ubiquitous language
meaning that the domain model should form a
 common language given by domain experts
 for describing system requirements, that
 works equally well for the business users
 or sponsors and for the software developers
Context
Multiple models are in play on any large project.
   Yet when code based on distinct models is combined, software becomes
   buggy, unreliable, and difficult to understand. Communication among team
   members becomes confused. It is often unclear in what context a model
   should not be applied.


•
Therefore:


•
    Explicitly define the context within which a model applies.
    Explicitly set boundaries in terms of team organization, usage within
    specific parts of the application, and physical manifestations such as code

•
    bases and database schemas.
    Keep the model strictly consistent within these bounds, but don’t be
    distracted or confused by issues outside.
The modeling process flow
•
•
    Model and document business processes first.
    Select a candidate business process and work with the business domain

•
    experts to document it using the Ubiquitous Language.
    Identify all the services that are required for the candidate business
    process. These services can be atomic (single step) or orchestrated (multi-
    step with or without work-flow) in nature. They can also be business (e.g.

•
    Underwriting or Funding) or infrastructure (e.g. E-mail or Job Scheduling).
    Identify and document the state and behavior of the objects used by
    services identified in the previous step.
Architecture
A typical enterprise application architecture consists of the following four

•
    conceptual layers:
    User Interface (Presentation Layer): Responsible for presenting

•
    information to the user and interpreting user commands.
    Application Layer: This layer coordinates the application activity. It
    doesn't contain any business logic. It does not hold the state of business

•
    objects, but it can hold the state of an application task's progress.
    Domain Layer: This layer contains information about the business
    domain. The state of business objects is held here. Persistence of the
    business objects and possibly their state is delegated to the infrastructure

•
    layer.
    Infrastructure Layer: This layer acts as a supporting library for all the
    other layers. It provides communication between layers, implements
    persistence for business objects, contains supporting libraries for the user
    interface layer, etc.
Application layer
•   is responsible for the navigation between the UI screens in the application

•
    as well as the interaction with the application layers of other systems.
    can also perform the basic (non-business related) validation on the user
    input data before transmitting it to the other (lower) layers of the

•
    application.


•
    doesn't contain any business or domain related logic or data access logic.
    doesn't have any state reflecting a business use case but it can manage
    the state of the user session or the progress of a task.
Domain layer
•   is responsible for the concepts of business domain, information about the
    business use case and the business rules. Domain objects encapsulate

•
    the state and behavior of business entities.
    can also manage the state (session) of a business use case if the use
    case spans multiple user requests (e.g. loan registration process which
    consists of multiple steps: user entering the loan details, system returning
    the products and rates based on the loan parameters, user selecting a
    specific product/rate combination, and finally the system locking the loan

•
    for that rate).
    contains service objects that only have a defined operational behavior
    which is not part of any domain object. Services encapsulate behavior of

•
    the business domain that doesn't fit in the domain objects themselves.
    is the heart of the business application and should be well isolated from
    the other layers of the application. Also, it should not be dependent on the
    application frameworks used in the other layers
Design concepts
Following design aspects are considered as the main ingredients of the current
    DDD implementation recipe:


•
•
    Object Oriented Programming (OOP)


•
    Dependency Injection (DI)
    Aspect Oriented Programming (AOP)
The project flow
From a project management standpoint, a real-world DDD implementation
   project comprises the same phases as any other software development
   project.


•
These phases include:


•
    Model the domain


•
    Design


•
    Development


•
    Unit and Integration Testing
    Refine and refactor the domain model based on the design and

•
    development (Continuous Integration (CI) of model concepts).
    Repeat the above steps using the updated domain model (CI of domain
    implementation).
Benefits
•   It helps the team create a common model, between the business and IT
    stakeholders in the company, that the team can use to communicate about

•
    the business requirements, data entities, and process models.
    The model is modular, extensible and easy to maintain as the design

•
    reflects the business model.
    It improves the reusability and testability of the business domain objects.
Prerequisites for the
successful application of DDD
•
•
    Your domain is not trivial
    The project team has experience and interest in Object Oriented

•
    Programming/Design


•
    You have access to domain experts
    You have an iterative process
Resources
http://en.wikipedia.org/wiki/Domain-driven_design
http://www.infoq.com/articles/ddd-in-practice
http://en.wikipedia.org/wiki/Object-oriented_programming
http://en.wikipedia.org/wiki/Dependency_injection
http://en.wikipedia.org/wiki/Aspect-oriented_programming
http://www.udidahan.com/2007/04/21/domain-model-pattern/
http://en.wikipedia.org/wiki/Unified_Modeling_Language




•
Books:
     Domain-Driven Design, Tackling Complexity in the Heart of Software, Eric Evans, Addison

•
•
     Wesley
     Applying Domain-Driven Design and Patterns, Jimmy Nilsson, Addison Wesley
     Refactoring to Patterns, Joshua Kerievsky, Addison Wesley

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and Kafka
 
Modelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven DesignModelling a complex domain with Domain-Driven Design
Modelling a complex domain with Domain-Driven Design
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven development
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
 
¿Qué es docker?
¿Qué es docker?¿Qué es docker?
¿Qué es docker?
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Modeling microservices using DDD
Modeling microservices using DDDModeling microservices using DDD
Modeling microservices using DDD
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Microservices
MicroservicesMicroservices
Microservices
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 

Semelhante a Domain Driven Design

Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...
HostedbyConfluent
 
Software design for scientific applications
Software design for scientific applicationsSoftware design for scientific applications
Software design for scientific applications
Priyanka Lal
 

Semelhante a Domain Driven Design (20)

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"
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Non-functional requirements
Non-functional requirements Non-functional requirements
Non-functional requirements
 
Private cloud reference model ms
Private cloud reference model msPrivate cloud reference model ms
Private cloud reference model ms
 
Oracle Forms Modernization Roadmap
Oracle Forms Modernization RoadmapOracle Forms Modernization Roadmap
Oracle Forms Modernization Roadmap
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHP
 
Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...
 
Unit_1(Software and Software Engineering).pptx
Unit_1(Software and Software Engineering).pptxUnit_1(Software and Software Engineering).pptx
Unit_1(Software and Software Engineering).pptx
 
Design Engineering and Design concepts
Design Engineering and Design conceptsDesign Engineering and Design concepts
Design Engineering and Design concepts
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
 
DevOps Introduction - Main Concepts Description
DevOps Introduction - Main Concepts DescriptionDevOps Introduction - Main Concepts Description
DevOps Introduction - Main Concepts Description
 
A Case for Outside-In Design
A Case for Outside-In DesignA Case for Outside-In Design
A Case for Outside-In Design
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
OOSE UNIT-1.pdf
OOSE UNIT-1.pdfOOSE UNIT-1.pdf
OOSE UNIT-1.pdf
 
Development Guideline
Development GuidelineDevelopment Guideline
Development Guideline
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Android ppt with example of budget manager
Android ppt with example of budget managerAndroid ppt with example of budget manager
Android ppt with example of budget manager
 
Software design for scientific applications
Software design for scientific applicationsSoftware design for scientific applications
Software design for scientific applications
 

Último

9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
delhimodel235
 
Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)
Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)
Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)
delhi24hrs1
 
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
asmaqueen5
 
9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi
delhimodel235
 
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
asmaqueen5
 
MEQ Mainstreet Equity Corp Q2 2024 Investor Presentation
MEQ Mainstreet Equity Corp Q2 2024 Investor PresentationMEQ Mainstreet Equity Corp Q2 2024 Investor Presentation
MEQ Mainstreet Equity Corp Q2 2024 Investor Presentation
MEQ - Mainstreet Equity Corp.
 
Acibadem Konaklari Uskudar - Listin Turkey
Acibadem Konaklari Uskudar - Listin TurkeyAcibadem Konaklari Uskudar - Listin Turkey
Acibadem Konaklari Uskudar - Listin Turkey
Listing Turkey
 
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
delhimodel235
 

Último (20)

Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
Yedi Mavi TOBB Zeytinburnu - Listing Turkey
Yedi Mavi TOBB Zeytinburnu - Listing TurkeyYedi Mavi TOBB Zeytinburnu - Listing Turkey
Yedi Mavi TOBB Zeytinburnu - Listing Turkey
 
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
 
Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)
Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)
Cheap Rate ✨➥9711108085▻✨Call Girls In Malviya Nagar(Delhi)
 
Enjoy Night ≽ 8448380779 ≼ Call Girls In Huda City Centre (Gurgaon)
Enjoy Night ≽ 8448380779 ≼ Call Girls In Huda City Centre (Gurgaon)Enjoy Night ≽ 8448380779 ≼ Call Girls In Huda City Centre (Gurgaon)
Enjoy Night ≽ 8448380779 ≼ Call Girls In Huda City Centre (Gurgaon)
 
David Litt Foreclosure Specialist - Your Partner in Real Estate Success
David Litt Foreclosure Specialist - Your Partner in Real Estate SuccessDavid Litt Foreclosure Specialist - Your Partner in Real Estate Success
David Litt Foreclosure Specialist - Your Partner in Real Estate Success
 
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
 
9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 7 Delhi (Call Girls) Delhi
 
Premium Villa Projects in Sarjapur Road Bengaluru
Premium Villa Projects in Sarjapur Road BengaluruPremium Villa Projects in Sarjapur Road Bengaluru
Premium Villa Projects in Sarjapur Road Bengaluru
 
Mahindra Happinest Tathawade Pune Brochure.pdf
Mahindra Happinest Tathawade Pune Brochure.pdfMahindra Happinest Tathawade Pune Brochure.pdf
Mahindra Happinest Tathawade Pune Brochure.pdf
 
Ganga Platinum Kharadi Pune brochure.pdf
Ganga Platinum Kharadi Pune brochure.pdfGanga Platinum Kharadi Pune brochure.pdf
Ganga Platinum Kharadi Pune brochure.pdf
 
Rohan Harita Tathawade Pune Brochure.pdf
Rohan Harita Tathawade Pune Brochure.pdfRohan Harita Tathawade Pune Brochure.pdf
Rohan Harita Tathawade Pune Brochure.pdf
 
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
 
MEQ Mainstreet Equity Corp Q2 2024 Investor Presentation
MEQ Mainstreet Equity Corp Q2 2024 Investor PresentationMEQ Mainstreet Equity Corp Q2 2024 Investor Presentation
MEQ Mainstreet Equity Corp Q2 2024 Investor Presentation
 
Eldeco Dwarka Project In Delhi-brochure.pdf.pdf
Eldeco Dwarka Project In Delhi-brochure.pdf.pdfEldeco Dwarka Project In Delhi-brochure.pdf.pdf
Eldeco Dwarka Project In Delhi-brochure.pdf.pdf
 
Acibadem Konaklari Uskudar - Listin Turkey
Acibadem Konaklari Uskudar - Listin TurkeyAcibadem Konaklari Uskudar - Listin Turkey
Acibadem Konaklari Uskudar - Listin Turkey
 
Purva Soukhyam in Guduvancheri Chennai.pdf
Purva Soukhyam in Guduvancheri Chennai.pdfPurva Soukhyam in Guduvancheri Chennai.pdf
Purva Soukhyam in Guduvancheri Chennai.pdf
 
Parksville 96 Surrey Floor Plans May 2024
Parksville 96 Surrey Floor Plans May 2024Parksville 96 Surrey Floor Plans May 2024
Parksville 96 Surrey Floor Plans May 2024
 
Bridge & Elliot Ladner Floor Plans May 2024.pdf
Bridge & Elliot Ladner Floor Plans May 2024.pdfBridge & Elliot Ladner Floor Plans May 2024.pdf
Bridge & Elliot Ladner Floor Plans May 2024.pdf
 
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
 

Domain Driven Design

  • 2. What it is and what it is not? • "Domain" not like in "part of the URL", but like in "area of business expertise" • Wikipedia: (http://en.wikipedia.org/wiki/Domain-driven_design) Domain-driven design (DDD) is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of the core business concepts. The premise of domain- driven design is the following: o Placing the project's primary focus on the core domain and domain logic o Basing complex designs on a model o Initiating a creative collaboration between technical and domain experts to iteratively cut ever closer to the conceptual heart of the problem. o Domain-driven design is not a technology or a methodology. DDD provides a structure of practices and terminology for making design decisions that focus and accelerate software projects dealing with complicated domains.
  • 3. Core definitions Domain: A sphere of knowledge (ontology), influence, or activity. The subject • area to which the user applies a program is the domain of the software. Model: A system of abstractions that describes selected aspects of a • domain and can be used to solve problems related to that domain. Ubiquitous Language: A language structured around the domain model and used by all team members to connect all the activities of the team • with the software. Context: The setting in which a word or statement appears that determines its meaning.
  • 4. Building blocks of the model In DDD, there are artifacts to express, create, and retrieve domain models: • Entity: An object that is not defined by its attributes, but rather by a thread of continuity and its identity. • Value Object: An object that contains attributes but has no conceptual identity. They should be treated as immutable. • Aggregate: A collection of objects that are bound together by a root entity, otherwise known as an aggregate root. The aggregate root guarantees the consistency of changes being made within the aggregate by forbidding external objects from holding references to its members. • Service: When an operation does not conceptually belong to any object. Following the natural contours of the problem, you can implement these operations in services. • Repository: methods for retrieving domain objects should delegate to a specialized Repository object such that alternative storage implementations may be easily interchanged. • Factory: methods for creating domain objects should delegate to a specialized Factory object such that alternative implementations may be easily interchanged.
  • 5. Ubiquitous language meaning that the domain model should form a common language given by domain experts for describing system requirements, that works equally well for the business users or sponsors and for the software developers
  • 6. Context Multiple models are in play on any large project. Yet when code based on distinct models is combined, software becomes buggy, unreliable, and difficult to understand. Communication among team members becomes confused. It is often unclear in what context a model should not be applied. • Therefore: • Explicitly define the context within which a model applies. Explicitly set boundaries in terms of team organization, usage within specific parts of the application, and physical manifestations such as code • bases and database schemas. Keep the model strictly consistent within these bounds, but don’t be distracted or confused by issues outside.
  • 7. The modeling process flow • • Model and document business processes first. Select a candidate business process and work with the business domain • experts to document it using the Ubiquitous Language. Identify all the services that are required for the candidate business process. These services can be atomic (single step) or orchestrated (multi- step with or without work-flow) in nature. They can also be business (e.g. • Underwriting or Funding) or infrastructure (e.g. E-mail or Job Scheduling). Identify and document the state and behavior of the objects used by services identified in the previous step.
  • 8. Architecture A typical enterprise application architecture consists of the following four • conceptual layers: User Interface (Presentation Layer): Responsible for presenting • information to the user and interpreting user commands. Application Layer: This layer coordinates the application activity. It doesn't contain any business logic. It does not hold the state of business • objects, but it can hold the state of an application task's progress. Domain Layer: This layer contains information about the business domain. The state of business objects is held here. Persistence of the business objects and possibly their state is delegated to the infrastructure • layer. Infrastructure Layer: This layer acts as a supporting library for all the other layers. It provides communication between layers, implements persistence for business objects, contains supporting libraries for the user interface layer, etc.
  • 9. Application layer • is responsible for the navigation between the UI screens in the application • as well as the interaction with the application layers of other systems. can also perform the basic (non-business related) validation on the user input data before transmitting it to the other (lower) layers of the • application. • doesn't contain any business or domain related logic or data access logic. doesn't have any state reflecting a business use case but it can manage the state of the user session or the progress of a task.
  • 10. Domain layer • is responsible for the concepts of business domain, information about the business use case and the business rules. Domain objects encapsulate • the state and behavior of business entities. can also manage the state (session) of a business use case if the use case spans multiple user requests (e.g. loan registration process which consists of multiple steps: user entering the loan details, system returning the products and rates based on the loan parameters, user selecting a specific product/rate combination, and finally the system locking the loan • for that rate). contains service objects that only have a defined operational behavior which is not part of any domain object. Services encapsulate behavior of • the business domain that doesn't fit in the domain objects themselves. is the heart of the business application and should be well isolated from the other layers of the application. Also, it should not be dependent on the application frameworks used in the other layers
  • 11. Design concepts Following design aspects are considered as the main ingredients of the current DDD implementation recipe: • • Object Oriented Programming (OOP) • Dependency Injection (DI) Aspect Oriented Programming (AOP)
  • 12. The project flow From a project management standpoint, a real-world DDD implementation project comprises the same phases as any other software development project. • These phases include: • Model the domain • Design • Development • Unit and Integration Testing Refine and refactor the domain model based on the design and • development (Continuous Integration (CI) of model concepts). Repeat the above steps using the updated domain model (CI of domain implementation).
  • 13.
  • 14. Benefits • It helps the team create a common model, between the business and IT stakeholders in the company, that the team can use to communicate about • the business requirements, data entities, and process models. The model is modular, extensible and easy to maintain as the design • reflects the business model. It improves the reusability and testability of the business domain objects.
  • 15. Prerequisites for the successful application of DDD • • Your domain is not trivial The project team has experience and interest in Object Oriented • Programming/Design • You have access to domain experts You have an iterative process