SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Domain Driven
Design
Fred Verheul
DDD Europe 2018
2
Agenda
• What is Domain Driven Design?
• Strategic patterns
• Tactical patterns
• Toolkit
3
What is Domain Driven Design (DDD)
• Not a technology or methodology
• Set of principles & patterns for focusing the design effort where it matters
most
• It’s all about:
• Understanding of the domain (subject area) where the software will be applied
• Creating a highly expressive model of that domain
• Distilling “Ubiquitous Language”
• Prerequisite: on-going collaboration between developers + domain experts
• When to apply: complex problems, high expectations
4
Ubiquitous Language
5
Domain Expert
Analyst Developer
Developer
Ubiquitous
Language
Application
code
Test code
Specs and
Documentation
Whiteboard
discussions
Strategic Patterns: Bounded Context
6
Context Map(-ping)
7
Tactical patterns: Building Blocks
• Value Objects
• Entities
• Aggregate Roots
• Repositories
• Services
• Factories
• Domain Events
8
Value Objects vs Entities
Entities:
Objects with an identity and a state
State evolves as long as application lives
Generally with a DB counterpart
Identifier Equality
9
Value Objects:
Have no conceptual identity
Can be designed as immutable
Can be shared between different entities
Structural Equality
Aggregates
• Cluster of objects
• Consistency Boundary
• Master object = aggregate root
10
Example, part 1 (Alberto Brandolini)
User Story 1:
As a Customer
I want to place an order
In order to purchase some goods
11
Example, part 2 (Alberto Brandolini)
User story 2, Returning
Customer:
As a customer
I want to retrieve my profile
in order to place more orders
12
Example, part 3 (Alberto Brandolini)
User story 3, Different
shipping address:
As a customer
I want to specify a valid
shipping address
In order to ship to a different
destination
13
Example, part 4 (Alberto Brandolini)
User story 4, Editable
customer profile:
As a customer
I want to edit my profile
In order to update it if
needed
14
Example, part 5 (Alberto Brandolini)
User story 5, Specify Billing
and Shipping Address:
As a customer
I want to specify
independent billing and
shipping addresses
In order to deliver goods to
different locations
15
Example, part 6 (Alberto Brandolini)
User story 6, Track past
orders:
As a Legal Department
I want to track orders
In order to manage
litigations
16
Result of modeling to deeper insights
17
Toolkit
• Tactical patterns (discussed above)
• Property based testing
• CQRS (Command Query Responsibility Segregation)
• Event sourcing
• Hexagonal Architecture
• Refactoring (to domain objects)
• Event Storming
18
Domain Driven Design
19
Further reading
• Udi Dahan: http://udidahan.com
• On CQRS: http://udidahan.com/2009/12/09/clarified-cqrs/
• Martin Fowler: https://martinfowler.com/intro.html
• On Event Sourcing: https://martinfowler.com/eaaDev/EventSourcing.html
• Greg Young:
• On CQRS: https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf
• Vaughn Vernon: https://vaughnvernon.co/
• On designing aggregates: https://vaughnvernon.co/?p=838
20
Further reading on property based testing
• http://blog.jessitron.com/2013/04/property-based-testing-what-is-it.html
• https://hypothesis.works/articles/what-is-property-based-testing/
• https://fsharpforfunandprofit.com/posts/property-based-testing/
• https://propertesting.com/book_foundations_of_property_based_testing.html
• http://www.erikschierboom.com/2016/02/22/property-based-testing/
21
Further reading
• Hexagonal Architecture:
• http://alistair.cockburn.us/Hexagonal+architecture
• https://www.infoq.com/news/2014/10/exploring-hexagonal-architecture
• Refactoring:
• https://refactoring.com/
22
Thank You
www.soapeople.com
info@soapeople.com
@SOAPEOPLE
Fred Verheul
Development Consultant
+31 6 3919 2986
fred.verheul@soapeople.com

Weitere ähnliche Inhalte

Ähnlich wie Domain Driven Design

Raja_Prabhu_Temenos
Raja_Prabhu_TemenosRaja_Prabhu_Temenos
Raja_Prabhu_TemenosRajaprabhu S
 
Srikanth Gattu-SharePoint Developer
Srikanth Gattu-SharePoint DeveloperSrikanth Gattu-SharePoint Developer
Srikanth Gattu-SharePoint Developersrikanth gattu
 
Domain Driven Design @ NewStore
Domain Driven Design @ NewStoreDomain Driven Design @ NewStore
Domain Driven Design @ NewStoreBernardo Torres
 
MongoDB World 2018: Data Analytics with MongoDB
MongoDB World 2018: Data Analytics with MongoDBMongoDB World 2018: Data Analytics with MongoDB
MongoDB World 2018: Data Analytics with MongoDBMongoDB
 
10 tips for enabling data discovery and governance in your organization
10 tips for enabling data discovery and governance in your organization10 tips for enabling data discovery and governance in your organization
10 tips for enabling data discovery and governance in your organizationHostedbyConfluent
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsAlexander van Trijffel
 
GRUG 2.0 6 Digital Guerrilla Validation 20180503
GRUG 2.0 6 Digital Guerrilla Validation 20180503GRUG 2.0 6 Digital Guerrilla Validation 20180503
GRUG 2.0 6 Digital Guerrilla Validation 20180503Glasgow Revit User Group
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDDEduards Sizovs
 
Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...
Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...
Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...Mark Peterson
 
FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...
FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...
FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...FIWARE
 
Webinar: Leveraging New Technologies with Migration
Webinar: Leveraging New Technologies with MigrationWebinar: Leveraging New Technologies with Migration
Webinar: Leveraging New Technologies with Migrationpanagenda
 
Kaggle Vs Real-world Projects
Kaggle Vs Real-world ProjectsKaggle Vs Real-world Projects
Kaggle Vs Real-world ProjectsAnkit Rathi
 
Introduction to Smart Data Models
Introduction to Smart Data ModelsIntroduction to Smart Data Models
Introduction to Smart Data ModelsFIWARE
 
Building a modern in-house analytics pipeline
Building a modern in-house analytics pipelineBuilding a modern in-house analytics pipeline
Building a modern in-house analytics pipelineSergey Burkov
 
Solving Real World Challenges with Enterprise Search
Solving Real World Challenges with Enterprise SearchSolving Real World Challenges with Enterprise Search
Solving Real World Challenges with Enterprise SearchSPC Adriatics
 
Webinar: How to Drive Business Value in Financial Services with MongoDB
Webinar: How to Drive Business Value in Financial Services with MongoDBWebinar: How to Drive Business Value in Financial Services with MongoDB
Webinar: How to Drive Business Value in Financial Services with MongoDBMongoDB
 
Creating a Documentation Portal
Creating a Documentation PortalCreating a Documentation Portal
Creating a Documentation PortalSteve Anderson
 
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialO'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialTom Hofte
 

Ähnlich wie Domain Driven Design (20)

Raja_Prabhu_Temenos
Raja_Prabhu_TemenosRaja_Prabhu_Temenos
Raja_Prabhu_Temenos
 
Srikanth Gattu-SharePoint Developer
Srikanth Gattu-SharePoint DeveloperSrikanth Gattu-SharePoint Developer
Srikanth Gattu-SharePoint Developer
 
Domain Driven Design @ NewStore
Domain Driven Design @ NewStoreDomain Driven Design @ NewStore
Domain Driven Design @ NewStore
 
MongoDB World 2018: Data Analytics with MongoDB
MongoDB World 2018: Data Analytics with MongoDBMongoDB World 2018: Data Analytics with MongoDB
MongoDB World 2018: Data Analytics with MongoDB
 
10 tips for enabling data discovery and governance in your organization
10 tips for enabling data discovery and governance in your organization10 tips for enabling data discovery and governance in your organization
10 tips for enabling data discovery and governance in your organization
 
Applying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain ModelsApplying Domain-Driven Design to craft Rich Domain Models
Applying Domain-Driven Design to craft Rich Domain Models
 
GRUG 2.0 6 Digital Guerrilla Validation 20180503
GRUG 2.0 6 Digital Guerrilla Validation 20180503GRUG 2.0 6 Digital Guerrilla Validation 20180503
GRUG 2.0 6 Digital Guerrilla Validation 20180503
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...
Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...
Lavacon 2014: But will it fit in my bathroom? Creating a single interface for...
 
FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...
FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...
FIWARE Wednesday Webinars - Cities as Enablers of the Data Economy: Smart Dat...
 
Webinar: Leveraging New Technologies with Migration
Webinar: Leveraging New Technologies with MigrationWebinar: Leveraging New Technologies with Migration
Webinar: Leveraging New Technologies with Migration
 
SharePoint Custom Development
SharePoint Custom DevelopmentSharePoint Custom Development
SharePoint Custom Development
 
Kaggle Vs Real-world Projects
Kaggle Vs Real-world ProjectsKaggle Vs Real-world Projects
Kaggle Vs Real-world Projects
 
Introduction to Smart Data Models
Introduction to Smart Data ModelsIntroduction to Smart Data Models
Introduction to Smart Data Models
 
Building a modern in-house analytics pipeline
Building a modern in-house analytics pipelineBuilding a modern in-house analytics pipeline
Building a modern in-house analytics pipeline
 
Solving Real World Challenges with Enterprise Search
Solving Real World Challenges with Enterprise SearchSolving Real World Challenges with Enterprise Search
Solving Real World Challenges with Enterprise Search
 
Webinar: How to Drive Business Value in Financial Services with MongoDB
Webinar: How to Drive Business Value in Financial Services with MongoDBWebinar: How to Drive Business Value in Financial Services with MongoDB
Webinar: How to Drive Business Value in Financial Services with MongoDB
 
Creating a Documentation Portal
Creating a Documentation PortalCreating a Documentation Portal
Creating a Documentation Portal
 
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialO'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
 

KĂźrzlich hochgeladen

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto GonzĂĄlez Trastoy
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

KĂźrzlich hochgeladen (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Domain Driven Design

  • 3. Agenda • What is Domain Driven Design? • Strategic patterns • Tactical patterns • Toolkit 3
  • 4. What is Domain Driven Design (DDD) • Not a technology or methodology • Set of principles & patterns for focusing the design effort where it matters most • It’s all about: • Understanding of the domain (subject area) where the software will be applied • Creating a highly expressive model of that domain • Distilling “Ubiquitous Language” • Prerequisite: on-going collaboration between developers + domain experts • When to apply: complex problems, high expectations 4
  • 5. Ubiquitous Language 5 Domain Expert Analyst Developer Developer Ubiquitous Language Application code Test code Specs and Documentation Whiteboard discussions
  • 8. Tactical patterns: Building Blocks • Value Objects • Entities • Aggregate Roots • Repositories • Services • Factories • Domain Events 8
  • 9. Value Objects vs Entities Entities: Objects with an identity and a state State evolves as long as application lives Generally with a DB counterpart Identifier Equality 9 Value Objects: Have no conceptual identity Can be designed as immutable Can be shared between different entities Structural Equality
  • 10. Aggregates • Cluster of objects • Consistency Boundary • Master object = aggregate root 10
  • 11. Example, part 1 (Alberto Brandolini) User Story 1: As a Customer I want to place an order In order to purchase some goods 11
  • 12. Example, part 2 (Alberto Brandolini) User story 2, Returning Customer: As a customer I want to retrieve my profile in order to place more orders 12
  • 13. Example, part 3 (Alberto Brandolini) User story 3, Different shipping address: As a customer I want to specify a valid shipping address In order to ship to a different destination 13
  • 14. Example, part 4 (Alberto Brandolini) User story 4, Editable customer profile: As a customer I want to edit my profile In order to update it if needed 14
  • 15. Example, part 5 (Alberto Brandolini) User story 5, Specify Billing and Shipping Address: As a customer I want to specify independent billing and shipping addresses In order to deliver goods to different locations 15
  • 16. Example, part 6 (Alberto Brandolini) User story 6, Track past orders: As a Legal Department I want to track orders In order to manage litigations 16
  • 17. Result of modeling to deeper insights 17
  • 18. Toolkit • Tactical patterns (discussed above) • Property based testing • CQRS (Command Query Responsibility Segregation) • Event sourcing • Hexagonal Architecture • Refactoring (to domain objects) • Event Storming 18
  • 20. Further reading • Udi Dahan: http://udidahan.com • On CQRS: http://udidahan.com/2009/12/09/clarified-cqrs/ • Martin Fowler: https://martinfowler.com/intro.html • On Event Sourcing: https://martinfowler.com/eaaDev/EventSourcing.html • Greg Young: • On CQRS: https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf • Vaughn Vernon: https://vaughnvernon.co/ • On designing aggregates: https://vaughnvernon.co/?p=838 20
  • 21. Further reading on property based testing • http://blog.jessitron.com/2013/04/property-based-testing-what-is-it.html • https://hypothesis.works/articles/what-is-property-based-testing/ • https://fsharpforfunandprofit.com/posts/property-based-testing/ • https://propertesting.com/book_foundations_of_property_based_testing.html • http://www.erikschierboom.com/2016/02/22/property-based-testing/ 21
  • 22. Further reading • Hexagonal Architecture: • http://alistair.cockburn.us/Hexagonal+architecture • https://www.infoq.com/news/2014/10/exploring-hexagonal-architecture • Refactoring: • https://refactoring.com/ 22
  • 23. Thank You www.soapeople.com info@soapeople.com @SOAPEOPLE Fred Verheul Development Consultant +31 6 3919 2986 fred.verheul@soapeople.com

Hinweis der Redaktion

  1. Source: https://martinfowler.com/bliki/BoundedContext.html
  2. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html
  3. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html
  4. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html
  5. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html
  6. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html
  7. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html
  8. Source: http://ziobrando.blogspot.com/2010/06/about-entities-aggregates-and-data.html