SlideShare a Scribd company logo
Domain Driven
Design (DDD)
Muhammad Ali
Conway's law
“Any organization that designs a system (defined more broadly here than just
information systems) will inevitably produce a design whose structure is a copy of the
organization's communication structure.”
What is domain-driven design
 Domain-Driven Design is an approach to the development of complex software in which we:
 Focus on core domain
 Explore models in a creative collaboration of domain practitioners and software practitioners
 Speak a ubiquitous language with in an explicitly bounded context
Goal
 A domain specific project that needs to leverage multiple realms of expertise specifically
 Design and Developer expertise
 Domain specific expertise
Glass Law
“Requirement deficiencies are the prime source for project failures”
Complications
 Most of the times developers speak in terms of Objects, composition, aggregation, inheritance, polymorphism,
pure functions etc.
 They talk more about technical solution rather than the problem itself.
 At times they don’t understand the underlying complexity and overcommit.
 Domain expert don’t know any of these, he has his own jargons regarding the domain.
 For example marketing people talking about leads, ads, campaigns, budgeting units etc.
 Similarly domain expert in airline talking about crew planning, SAFE, roster planning, FBO, PFA etc.
Boehm’s First Law
“Errors are most frequent during the requirements and design activities and are the
more expensive the later they are removed”
Solution
 Strengthen the communication process and establish a methodology for making those communication more
robust
 This is primarily accomplished by developing a UBIQUITOUS LANGUAGE and single model
 Make sure your developers speak this ubiquitous language.
 Persistent use of the UBIQUITOUS LANGUAGE will force the model's weaknesses into the open
 Building a language like this has a clear outcome:
 Language and model are strongly interconnected with each other
 Any changes to the language will be recognized as changes in the domain model
Domain Model
 A system of abstraction that describes selected aspects of a domain and can be used to solve problems related
to that domain.
 A domain model in not a particular(UML) diagram(unlike Model-Driven Design), it is the idea that diagram is
intended to convey.
 Model can be an expression in natural language, code or a diagram.
 Model is not a design artifact
 Model are the backbone of domain-driven design
 The model is distilled knowledge
 It is not just the knowledge in a domain expert's head; it is a rigorously organized and selective abstraction of
that knowledge
Implementation
 Once Domain Model is defined, you can identify different components based on their properties
 You can divide your solution into different layers(so called layered architecture, MVP, MVC,VIPER, MVVM etc)
 For example following we can break down our solution into following layers
 Presentation Layer (UI or ReST/SOAP/XMLRPC)
 Application Layer (Define the jobs that software is supposed to do and direct the expressive domain objects to work
out problems.)
 Domain Layer(Contains Business Logic)
 Infrastructure Layer(Provides generic technical capabilities, like message sending, persistence etc.)
 There can be multiple layers with different names however Domain-Driven design only requires domain layer.
Entities
 An object defined primarily by its identity is called an Entity.
 Each entity must have an operational way of establishing its identity with another object
 An identifying attribute must be guaranteed to be unique within the system however that system is defined,
even if distributed, even when objects are archived
Value Objects
 An object that represents a descriptive aspect of the domain with no conceptual identity is called aValue
Object.
 The attributes that make up aValue Object should form a conceptual whole
 Immutability should also be considered when designingValue Objects
 As long as aValue Object is immutable, change management is simple
Services
 There are important domain operations that can't find a natural home in an Entity orValue Object
 A Service is an operation offered as an interface that stands alone in the model, without encapsulating state, as
Entities andValue Objects do.
 Services are a common pattern in technical frameworks, but they can also apply in the domain layer.
 A good service has following characteristics
 The interface is defined in terms of other elements of the domain model
 The operation relates to a domain concept that is not a natural part of an Entity orValue Object.
Aggregates
 An aggregate is a cluster of domain objects that can be treated as a single unit
 Aggregates are the basic element of transfer of data storage - you request to load or save whole aggregates.
Transactions should not cross aggregate boundaries.
 An aggregate will have one of its component objects be the aggregate root.
 Any references from outside the aggregate should only go to the aggregate root.
 The root can thus ensure the integrity of the aggregate as a whole.
 A delete operation must remove everything within the aggregate boundary at once
 When a change to any object within the aggregate boundary is committed, all invariants of the whole aggregate
must be satisfied.When a change to any object within the aggregate boundary is committed, all invariants of
the whole aggregate must be satisfied.
Bounded Context
 Bounded Context is a central pattern in Domain-Driven Design
 DDD deals with large models by dividing them into different Bounded Contexts and being explicit about their
interrelationships
 Total unification of the domain model for a large system will not be feasible or cost-effective
 So instead DDD divides up a large system into Bounded Contexts, each of which can have a unified model
Context Map
 An individual Bounded Context still does not provide a global view.The context of other models may still be
vague and in flux
 Code reuse between Bounded Context is a hazard to be avoided.
 A Context Map is the overlap between project management and software design.
 A Context Map is a document which outlines the different Bounded Contexts and the relationships between
them.
 The level of detail may vary. What it is important is that everyone working on the project shares and
understands it.
Event Storming
 The smartest approach to collaboration beyond silo boundaries
 Event Storming is a flexible workshop format for collaborative exploration of complex business domains.
 Event storming is a rapid group modeling approach to domain-driven design.
 Originally created by Alberto Brandolini in 2012 as a quick alternative to precise UML diagramming
 Extremely lightweight, and doesn’t require any gadget
 The business process is "stormed out" as a series of domain events
 Result is a set of sticky notes consists of command, event, aggregate, view, business process, issues and
external system
Sysop Squad
 An electronics giant needs a new trouble-ticket system for their customer-facing IT consultants (the Sysop
Squad) in their stores nationwide
 Requirements: trouble tickets can be entered by either call-center receptionists, store staff or customers
online; tickets route to the appropriate consultant based on location, availability and skill; customers enter
consultant evaluation after service; consultant tracks work performed in customer record(s) for future reference
 Users: thousands of customers, hundreds of consultants, hundreds of store staff
Sysop Squad
 An electronics giant needs a new trouble-ticket system for their customer-facing IT consultants (the Sysop
Squad) in their stores nationwide
 Requirements:TroubleTickets can be entered by either call-center Receptionists, StoreStaff or Customers online;
tickets route to the appropriate Consultant based on location, availability and skill; customers enter consultant
evaluation after service; consultant tracks work performed in customer record(s) for future reference
 Users: thousands of customers, hundreds of consultants, hundreds of store staff
Sysop Squad
 An electronics giant needs a new trouble-ticket system for their customer-facing IT consultants (the Sysop
Squad) in their stores nationwide
 Requirements:TroubleTickets can be entered by either call-center receptionists, store staff or customers
online; tickets route to the appropriate consultant based on location, availability and skill; customers enter
consultant evaluation after service; consultant tracks work performed in customer record(s) for future
reference
 Users: thousands of customers, hundreds of consultants, hundreds of store staff
Identifying Entities & Value Objects
 Ticket
 Receptionist
 Store Staff
 Customer
 Consultant
 Consultant Evaluation
 Work Log
Entities Value Objects
Identifying Actions
 AddTicket
 Routing
 Service
 Consultant Evaluation
 TrackWork
Attributes
 What about other attributes? Like
 Location awareness
 Skills
 Availability
Results
Results
“All models are wrong; some models are useful”
George E. P. Box
Questions?

More Related Content

What's hot

DDD Basics - Context mapping
DDD Basics - Context mappingDDD Basics - Context mapping
DDD Basics - Context mapping
Stijn Volders
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven Design
Christos Tsakostas
 
The Art of Visualising Software - Simon Brown
The Art of Visualising Software - Simon BrownThe Art of Visualising Software - Simon Brown
The Art of Visualising Software - Simon Brown
Valtech UK
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
Andriy Buday
 
Software architecture for developers by Simon Brown
Software architecture for developers by Simon BrownSoftware architecture for developers by Simon Brown
Software architecture for developers by Simon Brown
Codemotion
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
Alan Christensen
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
Tom Kocjan
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
Abdul Karim
 
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Mozaic Works
 
Workflow diagramming and information architecture
Workflow diagramming and information architectureWorkflow diagramming and information architecture
Workflow diagramming and information architecture
Dianna Miller
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
wojtek_s
 
A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slides
thinkddd
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
Mariam Hakobyan
 
Domain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring PortfolioDomain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring Portfolio
Srini Penchikala
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
Sudarsun Santhiappan
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
Geeks Anonymes
 
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
Naeem Sarfraz
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011thinkddd
 
Domain-Driven Design Basics
Domain-Driven Design BasicsDomain-Driven Design Basics
Domain-Driven Design Basics
Mathias Verraes
 

What's hot (19)

DDD Basics - Context mapping
DDD Basics - Context mappingDDD Basics - Context mapping
DDD Basics - Context mapping
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven Design
 
The Art of Visualising Software - Simon Brown
The Art of Visualising Software - Simon BrownThe Art of Visualising Software - Simon Brown
The Art of Visualising Software - Simon Brown
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Software architecture for developers by Simon Brown
Software architecture for developers by Simon BrownSoftware architecture for developers by Simon Brown
Software architecture for developers by Simon Brown
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
 
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
Simon Brown: Software Architecture as Code at I T.A.K.E. Unconference 2015
 
Workflow diagramming and information architecture
Workflow diagramming and information architectureWorkflow diagramming and information architecture
Workflow diagramming and information architecture
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slides
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
 
Domain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring PortfolioDomain Driven Design Development Spring Portfolio
Domain Driven Design Development Spring Portfolio
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
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
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011
 
Domain-Driven Design Basics
Domain-Driven Design BasicsDomain-Driven Design Basics
Domain-Driven Design Basics
 

Similar to Domain Driven Design

Seminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRSSeminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRSMizanur Sarker
 
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"
GlobalLogic Ukraine
 
DDD eXchange
DDD eXchangeDDD eXchange
DDD eXchange
Skills Matter
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
Up2 Technology
 
Introduction to Domain driven design
Introduction to Domain driven designIntroduction to Domain driven design
Introduction to Domain driven design
Muhammad Ali
 
Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016
Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016
Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016
Sebastian Verheughe
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
Arnaud Bouchez
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
Alessandro Giorgetti
 
Designingapplswithnet
DesigningapplswithnetDesigningapplswithnet
Designingapplswithnet
DSK Chakravarthy
 
The Big Picture - Integrating Buzzwords
The Big Picture - Integrating BuzzwordsThe Big Picture - Integrating Buzzwords
The Big Picture - Integrating Buzzwords
Alessandro Giorgetti
 
Domain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic ApproachDomain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic Approach
Panagiotis Papaioannou
 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
iasaglobal
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
Ben Stopford
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
Alessandro Giorgetti
 
From Components To Services
From Components To ServicesFrom Components To Services
From Components To Services
James Phillips
 
04 designing architectures
04 designing architectures04 designing architectures
04 designing architecturesMajong DevJfu
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
Skills Matter
 
L02 Architecture
L02 ArchitectureL02 Architecture
L02 Architecture
Ólafur Andri Ragnarsson
 
A Case for Outside-In Design
A Case for Outside-In DesignA Case for Outside-In Design
A Case for Outside-In Design
Sandro Mancuso
 

Similar to Domain Driven Design (20)

Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Seminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRSSeminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRS
 
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"
 
DDD eXchange
DDD eXchangeDDD eXchange
DDD eXchange
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Introduction to Domain driven design
Introduction to Domain driven designIntroduction to Domain driven design
Introduction to Domain driven design
 
Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016
Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016
Strategic Design by Architecture and Organisation @ FINN.no - JavaZone 2016
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Designingapplswithnet
DesigningapplswithnetDesigningapplswithnet
Designingapplswithnet
 
The Big Picture - Integrating Buzzwords
The Big Picture - Integrating BuzzwordsThe Big Picture - Integrating Buzzwords
The Big Picture - Integrating Buzzwords
 
Domain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic ApproachDomain Driven Design: Made Easy employing Systemic Approach
Domain Driven Design: Made Easy employing Systemic Approach
 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
 
From Components To Services
From Components To ServicesFrom Components To Services
From Components To Services
 
04 designing architectures
04 designing architectures04 designing architectures
04 designing architectures
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
 
L02 Architecture
L02 ArchitectureL02 Architecture
L02 Architecture
 
A Case for Outside-In Design
A Case for Outside-In DesignA Case for Outside-In Design
A Case for Outside-In Design
 

More from Muhammad Ali

Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
Muhammad Ali
 
WebRTC Introduction & Basics
WebRTC Introduction & BasicsWebRTC Introduction & Basics
WebRTC Introduction & Basics
Muhammad Ali
 
Introduction to Architectural Katas
Introduction to Architectural KatasIntroduction to Architectural Katas
Introduction to Architectural Katas
Muhammad Ali
 
DBMS Modeling & Optimization
DBMS Modeling & OptimizationDBMS Modeling & Optimization
DBMS Modeling & Optimization
Muhammad Ali
 
Android architectural components
Android architectural componentsAndroid architectural components
Android architectural components
Muhammad Ali
 
Architectural katas
Architectural katasArchitectural katas
Architectural katas
Muhammad Ali
 
Software Architecture Meetup introduction
Software Architecture Meetup introductionSoftware Architecture Meetup introduction
Software Architecture Meetup introduction
Muhammad Ali
 
Practicing DDD & CQRS
Practicing DDD & CQRSPracticing DDD & CQRS
Practicing DDD & CQRS
Muhammad Ali
 

More from Muhammad Ali (8)

Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
 
WebRTC Introduction & Basics
WebRTC Introduction & BasicsWebRTC Introduction & Basics
WebRTC Introduction & Basics
 
Introduction to Architectural Katas
Introduction to Architectural KatasIntroduction to Architectural Katas
Introduction to Architectural Katas
 
DBMS Modeling & Optimization
DBMS Modeling & OptimizationDBMS Modeling & Optimization
DBMS Modeling & Optimization
 
Android architectural components
Android architectural componentsAndroid architectural components
Android architectural components
 
Architectural katas
Architectural katasArchitectural katas
Architectural katas
 
Software Architecture Meetup introduction
Software Architecture Meetup introductionSoftware Architecture Meetup introduction
Software Architecture Meetup introduction
 
Practicing DDD & CQRS
Practicing DDD & CQRSPracticing DDD & CQRS
Practicing DDD & CQRS
 

Recently uploaded

Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 

Recently uploaded (20)

Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 

Domain Driven Design

  • 2. Conway's law “Any organization that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organization's communication structure.”
  • 3. What is domain-driven design  Domain-Driven Design is an approach to the development of complex software in which we:  Focus on core domain  Explore models in a creative collaboration of domain practitioners and software practitioners  Speak a ubiquitous language with in an explicitly bounded context
  • 4. Goal  A domain specific project that needs to leverage multiple realms of expertise specifically  Design and Developer expertise  Domain specific expertise
  • 5. Glass Law “Requirement deficiencies are the prime source for project failures”
  • 6. Complications  Most of the times developers speak in terms of Objects, composition, aggregation, inheritance, polymorphism, pure functions etc.  They talk more about technical solution rather than the problem itself.  At times they don’t understand the underlying complexity and overcommit.  Domain expert don’t know any of these, he has his own jargons regarding the domain.  For example marketing people talking about leads, ads, campaigns, budgeting units etc.  Similarly domain expert in airline talking about crew planning, SAFE, roster planning, FBO, PFA etc.
  • 7. Boehm’s First Law “Errors are most frequent during the requirements and design activities and are the more expensive the later they are removed”
  • 8. Solution  Strengthen the communication process and establish a methodology for making those communication more robust  This is primarily accomplished by developing a UBIQUITOUS LANGUAGE and single model  Make sure your developers speak this ubiquitous language.  Persistent use of the UBIQUITOUS LANGUAGE will force the model's weaknesses into the open  Building a language like this has a clear outcome:  Language and model are strongly interconnected with each other  Any changes to the language will be recognized as changes in the domain model
  • 9. Domain Model  A system of abstraction that describes selected aspects of a domain and can be used to solve problems related to that domain.  A domain model in not a particular(UML) diagram(unlike Model-Driven Design), it is the idea that diagram is intended to convey.  Model can be an expression in natural language, code or a diagram.  Model is not a design artifact  Model are the backbone of domain-driven design  The model is distilled knowledge  It is not just the knowledge in a domain expert's head; it is a rigorously organized and selective abstraction of that knowledge
  • 10. Implementation  Once Domain Model is defined, you can identify different components based on their properties  You can divide your solution into different layers(so called layered architecture, MVP, MVC,VIPER, MVVM etc)  For example following we can break down our solution into following layers  Presentation Layer (UI or ReST/SOAP/XMLRPC)  Application Layer (Define the jobs that software is supposed to do and direct the expressive domain objects to work out problems.)  Domain Layer(Contains Business Logic)  Infrastructure Layer(Provides generic technical capabilities, like message sending, persistence etc.)  There can be multiple layers with different names however Domain-Driven design only requires domain layer.
  • 11. Entities  An object defined primarily by its identity is called an Entity.  Each entity must have an operational way of establishing its identity with another object  An identifying attribute must be guaranteed to be unique within the system however that system is defined, even if distributed, even when objects are archived
  • 12. Value Objects  An object that represents a descriptive aspect of the domain with no conceptual identity is called aValue Object.  The attributes that make up aValue Object should form a conceptual whole  Immutability should also be considered when designingValue Objects  As long as aValue Object is immutable, change management is simple
  • 13. Services  There are important domain operations that can't find a natural home in an Entity orValue Object  A Service is an operation offered as an interface that stands alone in the model, without encapsulating state, as Entities andValue Objects do.  Services are a common pattern in technical frameworks, but they can also apply in the domain layer.  A good service has following characteristics  The interface is defined in terms of other elements of the domain model  The operation relates to a domain concept that is not a natural part of an Entity orValue Object.
  • 14. Aggregates  An aggregate is a cluster of domain objects that can be treated as a single unit  Aggregates are the basic element of transfer of data storage - you request to load or save whole aggregates. Transactions should not cross aggregate boundaries.  An aggregate will have one of its component objects be the aggregate root.  Any references from outside the aggregate should only go to the aggregate root.  The root can thus ensure the integrity of the aggregate as a whole.  A delete operation must remove everything within the aggregate boundary at once  When a change to any object within the aggregate boundary is committed, all invariants of the whole aggregate must be satisfied.When a change to any object within the aggregate boundary is committed, all invariants of the whole aggregate must be satisfied.
  • 15. Bounded Context  Bounded Context is a central pattern in Domain-Driven Design  DDD deals with large models by dividing them into different Bounded Contexts and being explicit about their interrelationships  Total unification of the domain model for a large system will not be feasible or cost-effective  So instead DDD divides up a large system into Bounded Contexts, each of which can have a unified model
  • 16. Context Map  An individual Bounded Context still does not provide a global view.The context of other models may still be vague and in flux  Code reuse between Bounded Context is a hazard to be avoided.  A Context Map is the overlap between project management and software design.  A Context Map is a document which outlines the different Bounded Contexts and the relationships between them.  The level of detail may vary. What it is important is that everyone working on the project shares and understands it.
  • 17. Event Storming  The smartest approach to collaboration beyond silo boundaries  Event Storming is a flexible workshop format for collaborative exploration of complex business domains.  Event storming is a rapid group modeling approach to domain-driven design.  Originally created by Alberto Brandolini in 2012 as a quick alternative to precise UML diagramming  Extremely lightweight, and doesn’t require any gadget  The business process is "stormed out" as a series of domain events  Result is a set of sticky notes consists of command, event, aggregate, view, business process, issues and external system
  • 18. Sysop Squad  An electronics giant needs a new trouble-ticket system for their customer-facing IT consultants (the Sysop Squad) in their stores nationwide  Requirements: trouble tickets can be entered by either call-center receptionists, store staff or customers online; tickets route to the appropriate consultant based on location, availability and skill; customers enter consultant evaluation after service; consultant tracks work performed in customer record(s) for future reference  Users: thousands of customers, hundreds of consultants, hundreds of store staff
  • 19. Sysop Squad  An electronics giant needs a new trouble-ticket system for their customer-facing IT consultants (the Sysop Squad) in their stores nationwide  Requirements:TroubleTickets can be entered by either call-center Receptionists, StoreStaff or Customers online; tickets route to the appropriate Consultant based on location, availability and skill; customers enter consultant evaluation after service; consultant tracks work performed in customer record(s) for future reference  Users: thousands of customers, hundreds of consultants, hundreds of store staff
  • 20. Sysop Squad  An electronics giant needs a new trouble-ticket system for their customer-facing IT consultants (the Sysop Squad) in their stores nationwide  Requirements:TroubleTickets can be entered by either call-center receptionists, store staff or customers online; tickets route to the appropriate consultant based on location, availability and skill; customers enter consultant evaluation after service; consultant tracks work performed in customer record(s) for future reference  Users: thousands of customers, hundreds of consultants, hundreds of store staff
  • 21. Identifying Entities & Value Objects  Ticket  Receptionist  Store Staff  Customer  Consultant  Consultant Evaluation  Work Log Entities Value Objects
  • 22. Identifying Actions  AddTicket  Routing  Service  Consultant Evaluation  TrackWork
  • 23. Attributes  What about other attributes? Like  Location awareness  Skills  Availability
  • 26. “All models are wrong; some models are useful” George E. P. Box

Editor's Notes

  1. Make implicit concepts explicit
  2. Shared Kernel ACL Separate Ways Open Host Service Supple Design
  3. Shared Kernel ACL Separate Ways Open Host Service Supple Design
  4. Shared Kernel ACL Separate Ways Open Host Service Supple Design
  5. Shared Kernel ACL Separate Ways Open Host Service Supple Design
  6. Shared Kernel ACL Separate Ways Open Host Service Supple Design