SlideShare une entreprise Scribd logo
1  sur  63
Domain-Driven Design
          A Collaboration Between
  Domain Experts and Software Practitioners
The Book




           http://domaindrivendesign.org/books/evans_2003
do·main
dōˈmān n.
a sphere of knowledge,
in uence, or activity




      "domain." Merriam-Webster.com. 2011. http://www.merriam-webster.com/dictionary/domain (17 October 2011).
Core Domain
Core Domain
• complexity is in the domain, not the technology
Core Domain
• complexity is in the domain, not the technology
• let technology play a supporting role
Core Domain
• complexity is in the domain, not the technology
• let technology play a supporting role
• uncover your core domain and distill this core
The   Model*




        *In   domain-driven design, the model is not the classes or objects representing concepts within the model.
The    Model*

• a model is a tool for solving speci c problems within a domain




              *In   domain-driven design, the model is not the classes or objects representing concepts within the model.
The    Model*

• a model is a tool for solving speci c problems within a domain
• “the map is not the territory” —Alfred Korzybski




              *In   domain-driven design, the model is not the classes or objects representing concepts within the model.
The    Model*

• a model is a tool for solving speci c problems within a domain
• “the map is not the territory” —Alfred Korzybski
• collaborative explore the model with both domain experts
 and software practitioners




              *In   domain-driven design, the model is not the classes or objects representing concepts within the model.
Bounded Context
Bounded Context
• there are always multiple models
Bounded Context
• there are always multiple models
• explicitly de ne a bounded context to which a model applies
Bounded Context
• there are always multiple models
• explicitly de ne a bounded context to which a model applies
• speak a ubiquitous language within a bounded context
Building Blocks
Entity
Entity
• de ned by a thread of continuity and identity
Entity
• de ned by a thread of continuity and identity
• only responsibilities should be around identity and life cycle
Entity
• de ned by a thread of continuity and identity
• only responsibilities should be around identity and life cycle
• may be composed of other entities and/or value objects
Value Object
Value Object
• de ned by its encapsulated attributes
Value Object
• de ned by its encapsulated attributes
• treat value objects as immutable
Value Object
• de ned by its encapsulated attributes
• treat value objects as immutable
• delegate business logic to value objects
De ning an object as an entity or a
value object is context-dependent.
Aggregate
Aggregate
• a group of related entities and value objects
Aggregate
• a group of related entities and value objects
• useful when de ning transaction, distribution and
 concurrency boundaries
Aggregate
• a group of related entities and value objects
• useful when de ning transaction, distribution and
    concurrency boundaries
•   designate one entity as the aggregate root
Aggregate
• a group of related entities and value objects
• useful when de ning transaction, distribution and
    concurrency boundaries
•   designate one entity as the aggregate root
•   allow external references to only the aggregate root
Aggregate
• a group of related entities and value objects
• useful when de ning transaction, distribution and
    concurrency boundaries
•   designate one entity as the aggregate root
•   allow external references to only the aggregate root
•   delegate persistence of an aggregate root to a repository
Domain Event




               1. http://martinfowler.com/eaaDev/EventSourcing.html
Domain Event
• something important that happens within the domain that
 may lead to a state change in a domain object




                                     1. http://martinfowler.com/eaaDev/EventSourcing.html
Domain Event
• something important that happens within the domain that
    may lead to a state change in a domain object
•   current state can be computed by looking at all currently
    known domain events (a.k.a. event sourcing[1])




                                         1. http://martinfowler.com/eaaDev/EventSourcing.html
Domain Event
• something important that happens within the domain that
    may lead to a state change in a domain object
•   current state can be computed by looking at all currently
    known domain events (a.k.a. event sourcing[1])
•   domain events can trigger other domain events (e.g. three
    strikes triggers an out)




                                        1. http://martinfowler.com/eaaDev/EventSourcing.html
Supple Design
Closure of Operations
Closure of Operations
• have a method on a value object that returns an instance
 of the same type of value object
Closure of Operations
• have a method on a value object that returns an instance
    of the same type of value object
•   any method arguments should also be the same type as
    the value object
Closure of Operations
• have a method on a value object that returns an instance
    of the same type of value object
•   any method arguments should also be the same type as
    the value object
•   example: 2 + 3 = 5
Closure of Operations
• have a method on a value object that returns an instance
    of the same type of value object
•   any method arguments should also be the same type as
    the value object
•   example: 2 + 3 = 5
    • “2” is a value object of type number
Closure of Operations
• have a method on a value object that returns an instance
    of the same type of value object
•   any method arguments should also be the same type as
    the value object
•   example: 2 + 3 = 5
    • “2” is a value object of type number
    • number has an add method
Closure of Operations
• have a method on a value object that returns an instance
    of the same type of value object
•   any method arguments should also be the same type as
    the value object
•   example: 2 + 3 = 5
    • “2” is a value object of type number
    • number has an add method
    • add method accepts an argument of type number
Closure of Operations
• have a method on a value object that returns an instance
    of the same type of value object
•   any method arguments should also be the same type as
    the value object
•   example: 2 + 3 = 5
    • “2” is a value object of type number
    • number has an add method
    • add method accepts an argument of type number
    • add method returns a number
Other Techniques
• intention-revealing interfaces
• side-effect free functions
• assertions
Strategic Design
Context Map
Context Map
• draw a context map of the current bounded contexts
Context Map
• draw a context map of the current bounded contexts
• map what actually exists—not what you wish existed!
Context Map
• draw a context map of the current bounded contexts
• map what actually exists—not what you wish existed!
• identify relationships between contexts
Relationship Patterns
                   customer/            anticorruption
  partnership       supplier                 layer




shared kernel   big ball of         separate ways
                   mud




    open host          conformist           published
     service                                language
Distillation
Multiple Models
Multiple Models
• there are always multiple models
Multiple Models
• there are always multiple models
• a model my represent:
Multiple Models
• there are always multiple models
• a model my represent:
  • your core domain
Multiple Models
• there are always multiple models
• a model my represent:
  • your core domain
  • a supporting domain
Multiple Models
• there are always multiple models
• a model my represent:
  • your core domain
  • a supporting domain
  • a generic subdomain
Multiple Models
• there are always multiple models
• a model my represent:
   • your core domain
   • a supporting domain
   • a generic subdomain
• focus your modeling efforts on the core domain
Identifying the Core Domain
Ask organizational leaders and domain experts:
  • What keeps you awake at night?
  • What makes your system worth writing?
  • Why not buy it off the shelf?
  • Why not outsource it?
Don’t settle on not having
access to a domain expert!
Thank You
                                    @BradleyHolt
                               http://bradley-holt.com
                                 http://joind.in/4003




Copyright © 2011 Bradley Holt. All rights reserved.

Contenu connexe

Tendances

Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)IT Arena
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011thinkddd
 
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 SDLCAbdul Karim
 
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
 
DDD Basics - Context mapping
DDD Basics - Context mappingDDD Basics - Context mapping
DDD Basics - Context mappingStijn Volders
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignRyan Riley
 
Domain-Driven Design Basics
Domain-Driven Design BasicsDomain-Driven Design Basics
Domain-Driven Design BasicsMathias Verraes
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven DesignChristos Tsakostas
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignFrank Levering
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationOğuzhan Soykan
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introductionwojtek_s
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCSteven Smith
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignLalit Kale
 

Tendances (20)

Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)Domain-Driven Design (Artur Trosin Product Stream)
Domain-Driven Design (Artur Trosin Product Stream)
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011
 
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
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
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)
 
DDD Basics - Context mapping
DDD Basics - Context mappingDDD Basics - Context mapping
DDD Basics - Context mapping
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain-Driven Design Basics
Domain-Driven Design BasicsDomain-Driven Design Basics
Domain-Driven Design Basics
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
Introduction to Domain Driven Design
Introduction to Domain Driven DesignIntroduction to Domain Driven Design
Introduction to Domain Driven Design
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven Design
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Introduction to-ddd
Introduction to-dddIntroduction to-ddd
Introduction to-ddd
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVC
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 

Similaire à ZendCon 2011 UnCon Domain-Driven Design

Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design Allan Mangune
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven DesignBradley Holt
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoFu Cheng
 
Attain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design PatternsAttain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design PatternsMichael Reynolds
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheelsNaveenkumar Muguda
 
Functional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayFunctional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayDebasish Ghosh
 
Drupalcon cph
Drupalcon cphDrupalcon cph
Drupalcon cphcyberswat
 
walkmod - JUG talk
walkmod - JUG talkwalkmod - JUG talk
walkmod - JUG talkwalkmod
 
Javascript classes and scoping
Javascript classes and scopingJavascript classes and scoping
Javascript classes and scopingPatrick Sheridan
 
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...Lucidworks
 
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr..."PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...Stefan Adam
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Julie Meloni
 
33rd degree talk: open and automatic coding conventions with walkmod
33rd degree talk: open and automatic coding conventions with walkmod33rd degree talk: open and automatic coding conventions with walkmod
33rd degree talk: open and automatic coding conventions with walkmodwalkmod
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2Julie Iskander
 
Reactive GUI Implemented in Clojure
Reactive GUI Implemented in ClojureReactive GUI Implemented in Clojure
Reactive GUI Implemented in Clojuredenyslebediev
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Developmentkmloomis
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"GlobalLogic Ukraine
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Mediacurrent
 

Similaire à ZendCon 2011 UnCon Domain-Driven Design (20)

Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojo
 
Attain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design PatternsAttain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design Patterns
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheels
 
Functional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayFunctional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 Way
 
Drupalcon cph
Drupalcon cphDrupalcon cph
Drupalcon cph
 
walkmod - JUG talk
walkmod - JUG talkwalkmod - JUG talk
walkmod - JUG talk
 
Javascript classes and scoping
Javascript classes and scopingJavascript classes and scoping
Javascript classes and scoping
 
CBD.pptx
CBD.pptxCBD.pptx
CBD.pptx
 
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
 
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr..."PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
"PageRank" - "The Anatomy of a Large-Scale Hypertextual Web Search Engine” pr...
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
 
33rd degree talk: open and automatic coding conventions with walkmod
33rd degree talk: open and automatic coding conventions with walkmod33rd degree talk: open and automatic coding conventions with walkmod
33rd degree talk: open and automatic coding conventions with walkmod
 
Design Patterns.ppt
Design Patterns.pptDesign Patterns.ppt
Design Patterns.ppt
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Reactive GUI Implemented in Clojure
Reactive GUI Implemented in ClojureReactive GUI Implemented in Clojure
Reactive GUI Implemented in Clojure
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Development
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
 

Plus de Bradley Holt

Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012Bradley Holt
 
Entity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf BostonEntity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf BostonBradley Holt
 
CouchConf NYC CouchApps
CouchConf NYC CouchAppsCouchConf NYC CouchApps
CouchConf NYC CouchAppsBradley Holt
 
ZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDBZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDBBradley Holt
 
jQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsjQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsBradley Holt
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchAppsBradley Holt
 
OSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDBOSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDBBradley Holt
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with ApacheBradley Holt
 
CouchDB at New York PHP
CouchDB at New York PHPCouchDB at New York PHP
CouchDB at New York PHPBradley Holt
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3Bradley Holt
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHPBradley Holt
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web ServicesBradley Holt
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughBradley Holt
 
Burlington, VT PHP Users Group Subversion Presentation
Burlington, VT PHP Users Group Subversion PresentationBurlington, VT PHP Users Group Subversion Presentation
Burlington, VT PHP Users Group Subversion PresentationBradley Holt
 

Plus de Bradley Holt (15)

Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012Domain-Driven Design at ZendCon 2012
Domain-Driven Design at ZendCon 2012
 
Entity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf BostonEntity Relationships in a Document Database at CouchConf Boston
Entity Relationships in a Document Database at CouchConf Boston
 
CouchConf NYC CouchApps
CouchConf NYC CouchAppsCouchConf NYC CouchApps
CouchConf NYC CouchApps
 
ZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDBZendCon 2011 Learning CouchDB
ZendCon 2011 Learning CouchDB
 
jQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsjQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchApps
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchApps
 
OSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDBOSCON 2011 Learning CouchDB
OSCON 2011 Learning CouchDB
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with Apache
 
CouchDB at New York PHP
CouchDB at New York PHPCouchDB at New York PHP
CouchDB at New York PHP
 
Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Resource-Oriented Web Services
Resource-Oriented Web ServicesResource-Oriented Web Services
Resource-Oriented Web Services
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start Walkthrough
 
Burlington, VT PHP Users Group Subversion Presentation
Burlington, VT PHP Users Group Subversion PresentationBurlington, VT PHP Users Group Subversion Presentation
Burlington, VT PHP Users Group Subversion Presentation
 

Dernier

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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 organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Dernier (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

ZendCon 2011 UnCon Domain-Driven Design

  • 1. Domain-Driven Design A Collaboration Between Domain Experts and Software Practitioners
  • 2. The Book http://domaindrivendesign.org/books/evans_2003
  • 3. do·main dōˈmān n. a sphere of knowledge, in uence, or activity "domain." Merriam-Webster.com. 2011. http://www.merriam-webster.com/dictionary/domain (17 October 2011).
  • 5. Core Domain • complexity is in the domain, not the technology
  • 6. Core Domain • complexity is in the domain, not the technology • let technology play a supporting role
  • 7. Core Domain • complexity is in the domain, not the technology • let technology play a supporting role • uncover your core domain and distill this core
  • 8. The Model* *In domain-driven design, the model is not the classes or objects representing concepts within the model.
  • 9. The Model* • a model is a tool for solving speci c problems within a domain *In domain-driven design, the model is not the classes or objects representing concepts within the model.
  • 10. The Model* • a model is a tool for solving speci c problems within a domain • “the map is not the territory” —Alfred Korzybski *In domain-driven design, the model is not the classes or objects representing concepts within the model.
  • 11. The Model* • a model is a tool for solving speci c problems within a domain • “the map is not the territory” —Alfred Korzybski • collaborative explore the model with both domain experts and software practitioners *In domain-driven design, the model is not the classes or objects representing concepts within the model.
  • 13. Bounded Context • there are always multiple models
  • 14. Bounded Context • there are always multiple models • explicitly de ne a bounded context to which a model applies
  • 15. Bounded Context • there are always multiple models • explicitly de ne a bounded context to which a model applies • speak a ubiquitous language within a bounded context
  • 16.
  • 19. Entity • de ned by a thread of continuity and identity
  • 20. Entity • de ned by a thread of continuity and identity • only responsibilities should be around identity and life cycle
  • 21. Entity • de ned by a thread of continuity and identity • only responsibilities should be around identity and life cycle • may be composed of other entities and/or value objects
  • 23. Value Object • de ned by its encapsulated attributes
  • 24. Value Object • de ned by its encapsulated attributes • treat value objects as immutable
  • 25. Value Object • de ned by its encapsulated attributes • treat value objects as immutable • delegate business logic to value objects
  • 26. De ning an object as an entity or a value object is context-dependent.
  • 28. Aggregate • a group of related entities and value objects
  • 29. Aggregate • a group of related entities and value objects • useful when de ning transaction, distribution and concurrency boundaries
  • 30. Aggregate • a group of related entities and value objects • useful when de ning transaction, distribution and concurrency boundaries • designate one entity as the aggregate root
  • 31. Aggregate • a group of related entities and value objects • useful when de ning transaction, distribution and concurrency boundaries • designate one entity as the aggregate root • allow external references to only the aggregate root
  • 32. Aggregate • a group of related entities and value objects • useful when de ning transaction, distribution and concurrency boundaries • designate one entity as the aggregate root • allow external references to only the aggregate root • delegate persistence of an aggregate root to a repository
  • 33. Domain Event 1. http://martinfowler.com/eaaDev/EventSourcing.html
  • 34. Domain Event • something important that happens within the domain that may lead to a state change in a domain object 1. http://martinfowler.com/eaaDev/EventSourcing.html
  • 35. Domain Event • something important that happens within the domain that may lead to a state change in a domain object • current state can be computed by looking at all currently known domain events (a.k.a. event sourcing[1]) 1. http://martinfowler.com/eaaDev/EventSourcing.html
  • 36. Domain Event • something important that happens within the domain that may lead to a state change in a domain object • current state can be computed by looking at all currently known domain events (a.k.a. event sourcing[1]) • domain events can trigger other domain events (e.g. three strikes triggers an out) 1. http://martinfowler.com/eaaDev/EventSourcing.html
  • 39. Closure of Operations • have a method on a value object that returns an instance of the same type of value object
  • 40. Closure of Operations • have a method on a value object that returns an instance of the same type of value object • any method arguments should also be the same type as the value object
  • 41. Closure of Operations • have a method on a value object that returns an instance of the same type of value object • any method arguments should also be the same type as the value object • example: 2 + 3 = 5
  • 42. Closure of Operations • have a method on a value object that returns an instance of the same type of value object • any method arguments should also be the same type as the value object • example: 2 + 3 = 5 • “2” is a value object of type number
  • 43. Closure of Operations • have a method on a value object that returns an instance of the same type of value object • any method arguments should also be the same type as the value object • example: 2 + 3 = 5 • “2” is a value object of type number • number has an add method
  • 44. Closure of Operations • have a method on a value object that returns an instance of the same type of value object • any method arguments should also be the same type as the value object • example: 2 + 3 = 5 • “2” is a value object of type number • number has an add method • add method accepts an argument of type number
  • 45. Closure of Operations • have a method on a value object that returns an instance of the same type of value object • any method arguments should also be the same type as the value object • example: 2 + 3 = 5 • “2” is a value object of type number • number has an add method • add method accepts an argument of type number • add method returns a number
  • 46. Other Techniques • intention-revealing interfaces • side-effect free functions • assertions
  • 49. Context Map • draw a context map of the current bounded contexts
  • 50. Context Map • draw a context map of the current bounded contexts • map what actually exists—not what you wish existed!
  • 51. Context Map • draw a context map of the current bounded contexts • map what actually exists—not what you wish existed! • identify relationships between contexts
  • 52. Relationship Patterns customer/ anticorruption partnership supplier layer shared kernel big ball of separate ways mud open host conformist published service language
  • 55. Multiple Models • there are always multiple models
  • 56. Multiple Models • there are always multiple models • a model my represent:
  • 57. Multiple Models • there are always multiple models • a model my represent: • your core domain
  • 58. Multiple Models • there are always multiple models • a model my represent: • your core domain • a supporting domain
  • 59. Multiple Models • there are always multiple models • a model my represent: • your core domain • a supporting domain • a generic subdomain
  • 60. Multiple Models • there are always multiple models • a model my represent: • your core domain • a supporting domain • a generic subdomain • focus your modeling efforts on the core domain
  • 61. Identifying the Core Domain Ask organizational leaders and domain experts: • What keeps you awake at night? • What makes your system worth writing? • Why not buy it off the shelf? • Why not outsource it?
  • 62. Don’t settle on not having access to a domain expert!
  • 63. Thank You @BradleyHolt http://bradley-holt.com http://joind.in/4003 Copyright © 2011 Bradley Holt. All rights reserved.

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. Is a telephone number an entity or a value object? In a CRM, it’s probably a value object. In a telephone company, a phone number may be an entity.\n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n