SlideShare a Scribd company logo
1 of 25
Download to read offline
Domain
Driven
Design
Building Blocks

DDD-Meetup Cincinnati
2019-07-23

https://github.com/mwindholtz/presentations/tree/master/DDD
Domain-driven design (DDD)
An approach to software development
for complex needs
by connecting the implementation
to an evolving model.
The term was coined by Eric Evans
A Short Review or Overview …
Meeting Topic Areas
1. Strategic Patterns
• Context Maps, Sub Domains, etc
2. Tactical Patterns
• DomainEvents, Aggregates, etc
3. Communication Tips
• Whirlpool, Knowledge Crunching, Event Storming
4. Code Examples
• Build In Your Own Language: The Cargo Shipping Example
When to Apply Domain Design
• For Simple systems
• No worries. It fits inside a person’s head. REST
• For Medium systems
• No worries. Hire smart people so that ..
• It fits inside a person’s head. Oh and write loads of Documentation! **
• For Complex systems
• Starting is ok. It initially still fits inside a person’s head.
• Then Documents help a while
• But As It Grows …
** Documentation has an unknown expiration date.
And may be wrong to begin with.
Other restrictions may apply.
Typical “Agile” project progression
• Feature story
• Design, design, design :-)
• Feature story, Feature story
• Design. :-|
• Feature story, Feature story, Feature story, Feature story,
Feature story :-(
• Feature story, Feature story, Feature story, Feature story,
Feature story :-o
Code Structure:
Big Ball Of Mud
http://www.laputan.org/mud/

Process Diagnosis:

Featureatitis
Software Craftsmanship — IS NOT ENOUGH —
• Refactoring
• Better names
• Test Driven Design
• Continuous Single Integration
• Something is still missing
DDD Europe Videos 1999
“Doing” DDD
• Find Bounded Contexts

• Build Context Map

• Focus on Core Domain

• Apply Building Blocks

• Engage Domain Experts to
build Ubiquitous Language

• Repeat … (in parallel ?)
Application, in as we Imagine it
Application, as it Really is
Application with DDD added
Domain
• A sphere of knowledge, influence, or activity.
• The subject area to which the user applies a program is
the domain of the software.
Why Now ?
• Domain Driven Design, “Big Blue Book”, 2003
• Tactical Patterns get most of the attention
• Micro-Services, 2012
• Bounded Context and Context Mapping for organization
• Content of each Micro-Service
• Relationships among Micro-Services
Why is DDD Difficult to Explain?
• Since the Problem is Complex and Subtle
• The Solution is also Complex and Subtle
• Difficult to scale down into examples
• Large Vocabulary of Interrelated Patterns
• Pattern Languages
Building Blocks
• Layered Architecture

• Value Objects

• Entities

• Factories

• Repositories

• Aggregates
• Services
• Domain Events
Layered Architecture
Name Description Example
UI
Shows information to the user.

API to another system.
Web form

Json API
Application
Thin. No Biz Rules. Stateless except for
workflow progress. Use Cases.
Coordinator.

Funds Transfer
Service
Domain
Concepts of the Business, Biz Rules.

The heart of the business software.
*more later
Infrastructure
Support for the other layers. 

Message sending, persistence
Pub-Sub

DB
Building Blocks (part 1)
Name Description Example
Value Objects
Defined by the attributes, 

immutable
{2001,07,04}

{:cents_us, 299}

{ :grams, 300}
Entities
Thread of continuity and identity 

Customer

IoT device

Policy
Factories Atomic creation, enforcing invariants
Repositories


Saving and Reconstituting aggregates
Building Blocks (part 2)
Name Description Example
Aggregates
Cluster of assoc objs treated as a unit. 

The Root is an Entity. 

Hides the entities inside
Policy

IoT Site

Services Stateless, UseCase
Domain
Events
Verb in past tense that the Domain
Expert cares about
- Claim Rejected

- Purchase
Completed
Aggregate
• Protect Business Invariants inside Aggregate
• Reference Other Aggregates by Identity
• Update other Aggregates with Eventual Consistency
• Keep them Small
Services
• An Operation that relates to a domain concept that is not
a natural part of an ENTITY or a VALUE OBJECT
• The interface is defined in terms of other elements of the
domain model
• The Operation is stateless
• Services can be in Domain Layer or with a different focus
also in the Application Layer, or Infrastructure Layer
Domain Events
• Verb in past tense that the Domain Expert cares about
• Immutable
• Timestamped
• Primary or Derived from other Events
• Useful for distributed processes and eventual consistency
• Useful to find out why and when and entity changed.
CARGO SHIPPING
The End

More Related Content

What's hot

Leveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup projectLeveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup projectThomas Jaskula
 
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019Agile India
 
Pragmatic Architecture in .NET
Pragmatic Architecture in .NETPragmatic Architecture in .NET
Pragmatic Architecture in .NEThousecor
 
Pragmatic Architecture for Agile Teams - GeeCON 2014
Pragmatic Architecture for Agile Teams - GeeCON 2014Pragmatic Architecture for Agile Teams - GeeCON 2014
Pragmatic Architecture for Agile Teams - GeeCON 2014Janne Sinivirta
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseKevin Mas Ruiz
 
Real-world consistency explained
Real-world consistency explainedReal-world consistency explained
Real-world consistency explainedUwe Friedrichsen
 
Excavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsExcavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsUwe Friedrichsen
 
Resilient Functional Service Design
Resilient Functional Service DesignResilient Functional Service Design
Resilient Functional Service DesignUwe Friedrichsen
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion DubaiCodemotion Dubai
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net coreSam Nasr, MCSA, MVP
 
DevOpsDays Seattle - Self-Service Ignite
DevOpsDays Seattle - Self-Service IgniteDevOpsDays Seattle - Self-Service Ignite
DevOpsDays Seattle - Self-Service IgniteLowell Young
 

What's hot (19)

Leveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup projectLeveraging more then DDD Lite in the startup project
Leveraging more then DDD Lite in the startup project
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
Strategic Domain-Driven Design by Nick Tune at #AgileIndia2019
 
SOAT Agile Day 2017 DDD
SOAT Agile Day 2017 DDDSOAT Agile Day 2017 DDD
SOAT Agile Day 2017 DDD
 
Pragmatic Architecture in .NET
Pragmatic Architecture in .NETPragmatic Architecture in .NET
Pragmatic Architecture in .NET
 
Pragmatic Architecture for Agile Teams - GeeCON 2014
Pragmatic Architecture for Agile Teams - GeeCON 2014Pragmatic Architecture for Agile Teams - GeeCON 2014
Pragmatic Architecture for Agile Teams - GeeCON 2014
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD Course
 
iPad Apps for Lawyers
iPad Apps for LawyersiPad Apps for Lawyers
iPad Apps for Lawyers
 
A CQRS Journey
A CQRS JourneyA CQRS Journey
A CQRS Journey
 
Real-world consistency explained
Real-world consistency explainedReal-world consistency explained
Real-world consistency explained
 
Excavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsExcavating the knowledge of our ancestors
Excavating the knowledge of our ancestors
 
Resilient Functional Service Design
Resilient Functional Service DesignResilient Functional Service Design
Resilient Functional Service Design
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 
Watch your communication
Watch your communicationWatch your communication
Watch your communication
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
Lecture 29
Lecture 29Lecture 29
Lecture 29
 
All the cool kids....
All the cool kids....All the cool kids....
All the cool kids....
 
Death of a coder
Death of a coderDeath of a coder
Death of a coder
 
DevOpsDays Seattle - Self-Service Ignite
DevOpsDays Seattle - Self-Service IgniteDevOpsDays Seattle - Self-Service Ignite
DevOpsDays Seattle - Self-Service Ignite
 

Similar to DDD Building Blocks and Patterns Explained

Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)Tom Kocjan
 
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
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017Jonathan Wylliem
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignLalit Kale
 
Introduction to Domain-Driven Design
Introduction to Domain-Driven DesignIntroduction to Domain-Driven Design
Introduction to Domain-Driven DesignR-P-Azevedo
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSAndrea Saltarello
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignJulie Lerman
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Demi Ben-Ari
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableComsysto Reply GmbH
 
Up to speed in domain driven design
Up to speed in domain driven designUp to speed in domain driven design
Up to speed in domain driven designRick van der Arend
 
Cambridge Breakfast Seminar
Cambridge Breakfast SeminarCambridge Breakfast Seminar
Cambridge Breakfast SeminarNuoDB
 
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 and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven developmentDmitry Geyzersky
 
Docker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshDocker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshTony Pujals
 
Objectivity/DB: A Multipurpose NoSQL Database
Objectivity/DB: A Multipurpose NoSQL DatabaseObjectivity/DB: A Multipurpose NoSQL Database
Objectivity/DB: A Multipurpose NoSQL DatabaseInfiniteGraph
 
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
 

Similar to DDD Building Blocks and Patterns Explained (20)

Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
Java TechTalk "Spring boot made life easier with Kubernetes and Microservices"
 
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
Domain Driven Design Ruby Ways -  JURNAL 05/10/2017Domain Driven Design Ruby Ways -  JURNAL 05/10/2017
Domain Driven Design Ruby Ways - JURNAL 05/10/2017
 
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
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Idiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRSIdiomatic Domain Driven Design: implementing CQRS
Idiomatic Domain Driven Design: implementing CQRS
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Up to speed in domain driven design
Up to speed in domain driven designUp to speed in domain driven design
Up to speed in domain driven design
 
Cambridge Breakfast Seminar
Cambridge Breakfast SeminarCambridge Breakfast Seminar
Cambridge Breakfast Seminar
 
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 and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven development
 
Docker, Microservices, and the Service Mesh
Docker, Microservices, and the Service MeshDocker, Microservices, and the Service Mesh
Docker, Microservices, and the Service Mesh
 
Murali_CV
Murali_CVMurali_CV
Murali_CV
 
Objectivity/DB: A Multipurpose NoSQL Database
Objectivity/DB: A Multipurpose NoSQL DatabaseObjectivity/DB: A Multipurpose NoSQL Database
Objectivity/DB: A Multipurpose NoSQL Database
 
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
 

More from Mark Windholtz

XP-Retro from Codemash.org Jan 2018
XP-Retro from Codemash.org Jan 2018XP-Retro from Codemash.org Jan 2018
XP-Retro from Codemash.org Jan 2018Mark Windholtz
 
War between Tools and Design 2016
War between Tools and Design 2016War between Tools and Design 2016
War between Tools and Design 2016Mark Windholtz
 
2020-Feb: Testing: Cables and Chains
2020-Feb: Testing: Cables and Chains2020-Feb: Testing: Cables and Chains
2020-Feb: Testing: Cables and ChainsMark Windholtz
 
Planning XP - Extreme Programming
Planning XP - Extreme ProgrammingPlanning XP - Extreme Programming
Planning XP - Extreme ProgrammingMark Windholtz
 
2017 June AgileCincy Event Storming
2017 June AgileCincy Event Storming2017 June AgileCincy Event Storming
2017 June AgileCincy Event StormingMark Windholtz
 

More from Mark Windholtz (6)

XP-Retro from Codemash.org Jan 2018
XP-Retro from Codemash.org Jan 2018XP-Retro from Codemash.org Jan 2018
XP-Retro from Codemash.org Jan 2018
 
War between Tools and Design 2016
War between Tools and Design 2016War between Tools and Design 2016
War between Tools and Design 2016
 
2020-Feb: Testing: Cables and Chains
2020-Feb: Testing: Cables and Chains2020-Feb: Testing: Cables and Chains
2020-Feb: Testing: Cables and Chains
 
Planning XP - Extreme Programming
Planning XP - Extreme ProgrammingPlanning XP - Extreme Programming
Planning XP - Extreme Programming
 
2017 June AgileCincy Event Storming
2017 June AgileCincy Event Storming2017 June AgileCincy Event Storming
2017 June AgileCincy Event Storming
 
Planning XP
Planning XPPlanning XP
Planning XP
 

Recently uploaded

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

DDD Building Blocks and Patterns Explained

  • 2. Domain-driven design (DDD) An approach to software development for complex needs by connecting the implementation to an evolving model. The term was coined by Eric Evans
  • 3. A Short Review or Overview …
  • 4. Meeting Topic Areas 1. Strategic Patterns • Context Maps, Sub Domains, etc 2. Tactical Patterns • DomainEvents, Aggregates, etc 3. Communication Tips • Whirlpool, Knowledge Crunching, Event Storming 4. Code Examples • Build In Your Own Language: The Cargo Shipping Example
  • 5. When to Apply Domain Design • For Simple systems • No worries. It fits inside a person’s head. REST • For Medium systems • No worries. Hire smart people so that .. • It fits inside a person’s head. Oh and write loads of Documentation! ** • For Complex systems • Starting is ok. It initially still fits inside a person’s head. • Then Documents help a while • But As It Grows … ** Documentation has an unknown expiration date. And may be wrong to begin with. Other restrictions may apply.
  • 6. Typical “Agile” project progression • Feature story • Design, design, design :-) • Feature story, Feature story • Design. :-| • Feature story, Feature story, Feature story, Feature story, Feature story :-( • Feature story, Feature story, Feature story, Feature story, Feature story :-o
  • 7. Code Structure: Big Ball Of Mud http://www.laputan.org/mud/ Process Diagnosis: Featureatitis
  • 8. Software Craftsmanship — IS NOT ENOUGH — • Refactoring • Better names • Test Driven Design • Continuous Single Integration • Something is still missing
  • 10. “Doing” DDD • Find Bounded Contexts • Build Context Map • Focus on Core Domain • Apply Building Blocks • Engage Domain Experts to build Ubiquitous Language • Repeat … (in parallel ?)
  • 11. Application, in as we Imagine it
  • 12. Application, as it Really is
  • 14. Domain • A sphere of knowledge, influence, or activity. • The subject area to which the user applies a program is the domain of the software.
  • 15. Why Now ? • Domain Driven Design, “Big Blue Book”, 2003 • Tactical Patterns get most of the attention • Micro-Services, 2012 • Bounded Context and Context Mapping for organization • Content of each Micro-Service • Relationships among Micro-Services
  • 16. Why is DDD Difficult to Explain? • Since the Problem is Complex and Subtle • The Solution is also Complex and Subtle • Difficult to scale down into examples • Large Vocabulary of Interrelated Patterns • Pattern Languages
  • 17. Building Blocks • Layered Architecture • Value Objects • Entities • Factories • Repositories • Aggregates • Services • Domain Events
  • 18. Layered Architecture Name Description Example UI Shows information to the user. API to another system. Web form Json API Application Thin. No Biz Rules. Stateless except for workflow progress. Use Cases. Coordinator. Funds Transfer Service Domain Concepts of the Business, Biz Rules. The heart of the business software. *more later Infrastructure Support for the other layers. Message sending, persistence Pub-Sub DB
  • 19. Building Blocks (part 1) Name Description Example Value Objects Defined by the attributes, immutable {2001,07,04} {:cents_us, 299} { :grams, 300} Entities Thread of continuity and identity Customer IoT device Policy Factories Atomic creation, enforcing invariants Repositories Saving and Reconstituting aggregates
  • 20. Building Blocks (part 2) Name Description Example Aggregates Cluster of assoc objs treated as a unit. The Root is an Entity. Hides the entities inside Policy IoT Site Services Stateless, UseCase Domain Events Verb in past tense that the Domain Expert cares about - Claim Rejected - Purchase Completed
  • 21. Aggregate • Protect Business Invariants inside Aggregate • Reference Other Aggregates by Identity • Update other Aggregates with Eventual Consistency • Keep them Small
  • 22. Services • An Operation that relates to a domain concept that is not a natural part of an ENTITY or a VALUE OBJECT • The interface is defined in terms of other elements of the domain model • The Operation is stateless • Services can be in Domain Layer or with a different focus also in the Application Layer, or Infrastructure Layer
  • 23. Domain Events • Verb in past tense that the Domain Expert cares about • Immutable • Timestamped • Primary or Derived from other Events • Useful for distributed processes and eventual consistency • Useful to find out why and when and entity changed.