SlideShare a Scribd company logo
Domain
Driven
Design
And when not to use it

Cincinnati SC 2019-11-06

mark@agiledna.com
https://github.com/mwindholtz/presentations/DDD-SC-Cinci
Wikimedia Commons
About me: mark@agiledna.com
• Built …
• eCommence site for ~12 years
• Memberships site for ~8 years
• Elixir: CC Processing, Medical Research, Energy Grid
• DDD Since 2006
• TDD since 1999 — sUnit
• Learned from Kent Beck, Bob Martin, Eric Evans
About YOU
• What Drives Your Product Code Design?
Some Observed Drivers …
• UI Screens / API
• Database Model
• Doing Risk Items First, or Last
• Architect’s Personal Issues - opposite of last project
• Features, Features, more Features
Domain Driven Design, 2003
• Tackling Complexity in the
Heart of S/W
• By Eric Evans
• “The Big Blue Book”
Domain-Driven Design (DDD)
• For …
• complex needs
• connects implementation to evolving model
• DOMAIN is the problem space
• MODEL is an abstracted potential solution
• Code is code
DDD: From Debt to Dividend
• Tech Debt
• Paying interest plus principle to temporarily move faster
• Tech Dividend
• Getting extra value on deep design to unlock extra
features
DDD is a Set of Principles
• Core Domain - focus here
• Explore Models in a Collaboration of
• Domain experts and the software team
• Separate Business from Technical
• Speak in a Ubiquitous Language
• within a Bounded Context
When to Apply Domain Design
• For Simple systems
• No worries. It fits inside a person’s head.
• 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 …
** has an unknown expiration date.
** may also be wrong.
**Other restrictions may apply.
Warning !
• Simple Systems …
• Become Medium System …
• Which Become Complex systems
Why “Agile” Software becomes a Mess
• 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
Process Diagnosis:

Featureatitis
Design:
Preventing ripple effects
• Martin Fowler
Design Stamina Hypothesis
Software Craftsmanship — IS NOT ENOUGH —
• Refactoring
• Better names
• Test Driven Design
• Continuous Single Integration
• Something is still missing
Technical debt isn't
technical - Einar Høst -
DDD Europe 2019
DDD Prerequisites
• Close Collaboration of
Business
• Development in
Ubiquitous Language

• Iterative Development
DDD is Difficult to Explain. Why?
• Since the Problem is Complex and Subtle
• So is the Solution
• Difficult to scale down into examples
• Large Vocabulary of Interrelated Patterns
• Pattern Languages
Doing DDD - mark’s version
• Core Domain, and SubDomains

• Bounded Contexts

• Ubiquitous Language

• Building Blocks are Tactical Patterns

• Repeat … and Revisit
CORE DOMAIN
• A System Hard to understand is hard to change
• Boil down the MODEL
• Skilled developers are drawn to new tech
• Get top talent into the CORE DOMAIN
Application, as we Imagine it could be
Application, in Reality
Apply strategic patterns to find the Core Domain
DDD Topic Areas
• Strategic Patterns
• Tactical Patterns
• Communication Tips
Strategic Patterns
Finding & Separating 

The Core Domain
Wikimedia Commons
Bounded Context
• Large projects have multiple Models

• Combining Models causes bugs

• Model only has meaning in a context

• Therefore …
• Define the context of the Model

• Set boundaries in terms of 

• parts of the application

• team organization

• code bases, git-repositories
Acme
Internet of Things
Manager
ContextMap
• To develop a strategy, we need a
large-scale view across our project
and others we integrate with.

• Therefore …
• Describe the points of contact
between Models. 

• Explicit translations

• Sharing

• Isolation mechanisms

• Levels of influence
Acme
Internet of Things
Manager
Acme Smoke
Detector
Network
Arrow points
downstream
data flows
Data flows
to Manager
from Network
Smoke detector devices
DDD Topic Areas
• Strategic Patterns
• Tactical Patterns
• Communication Tips
Tactical Patterns
- Building Blocks
• Layered Architecture
• Aggregates
• Value Objects

• Entities

• Services

• Domain Events
Layered Architecture
Name Description Example
UI User Interface or API
Web form

Json API
Application
Thin. No Biz Rules. Stateless. 

Use Cases. Coordinator.

Funds Transfer
Service
Domain
Business Concepts, Biz Rules.

The heart of the business software.
DDD
Infrastructure Support for the other layers
Pub-Sub

DB
Aggregates in Layers - 1
Domain
Database
Application Service
UI
Gateway to External Services
API
Domain
Database
Application Service
UI
Gateway to External Services
API
A few other Building Blocks
Value Object
• Value only
{ :usd, 1000.00 }
{ :watt_hours, 900 }
Entity
• Life Cycle
• Has Identity field
%Order{ id: 2341334 }
%User{ id: 3421424 }
Aggregate
• Keep them Small
• Protect Business Invariants
inside Aggregate
• Reference Other Aggregates
by Identity only
• Update other Aggregates with
Eventual Consistency
•
Aggregates in Layers - 2
Domain
Database
Application Service
UI
Gateway to External Services
API
Domain
Database
Application Service
UI
Gateway to External Services
Aggregate AggregateAggregate Aggregate
API
Aggregates in Layers - 3
Domain
Database
Application Service
UI
Gateway to External Services
API
Domain
Database
Application Service
UI
Gateway to External Services
Aggregate
API
Root
Aggregates in Layers - 4
Domain
Database
Application Service
UI
Gateway to External Services
Event Bus
API
DDD Topic Areas
• Strategic Patterns
• Tactical Patterns
• Communication Tips
Communication Tips
• Investigate, question Constraints
• Listening for missing Words and Concepts
• Ask “Why?”
• Event Storming
• Whirlpool
Event Storming
Event Storming
MODEL Exploration
When to use Full-DDD
• Strategic, Tactical, Communication
• Increasing complexity is slowing down progress
• Defects about fundamental Model are increasing
• Edge Cases are increasing
When to use Partial-DDD - Strategic
• As an Architect
• Use Bounded Context to reduce confusion
• Context Mapping to see flow of the MODEL
• When: more then two main modules
When to use Partial-DDD - Tactical
• As a Developer: Use Building Blocks
• Layered Architecture, Aggregate
• TDD
• When: Increasing conditional statements
• When: DB accessed everywhere, big test setup
• When: DB Locking issues
When not to use DDD
• Simple CRUD / REST application needs
• Not using an iterative process
• Poor access to Domain Experts
• Build and forget apps
CRUD => Active Record => Domain Model => DDD
- Davin Tryon, via stack overflow
Just the beginning …
Acme
Internet of Things
Manager
Acme Smoke
Detector
Network

More Related Content

What's hot

Android application development
Android application developmentAndroid application development
Android application developmentLinh Vi Tường
 
Unlock the Power of Streaming Data with Kinetica and Confluent Platform
Unlock the Power of Streaming Data with Kinetica and Confluent PlatformUnlock the Power of Streaming Data with Kinetica and Confluent Platform
Unlock the Power of Streaming Data with Kinetica and Confluent Platformconfluent
 
Monolith to Microservices - O’Reilly Oscon
Monolith to Microservices - O’Reilly OsconMonolith to Microservices - O’Reilly Oscon
Monolith to Microservices - O’Reilly OsconChristopher Grant
 
Why we got to Docker
Why we got to DockerWhy we got to Docker
Why we got to Dockerallingeek
 
Overview of DITA 1.3
Overview of DITA 1.3Overview of DITA 1.3
Overview of DITA 1.3IXIASOFT
 
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
 
Java Community Webinar #8: “High Performance Systems Design”
Java Community Webinar #8: “High Performance Systems Design”Java Community Webinar #8: “High Performance Systems Design”
Java Community Webinar #8: “High Performance Systems Design”GlobalLogic Ukraine
 
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd mattersDDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd mattersKim Kao
 
The five expertise of a software architect
The five expertise of a software architectThe five expertise of a software architect
The five expertise of a software architectLior Bar-On
 
Building Blocks for Hybrid IT
Building Blocks for Hybrid ITBuilding Blocks for Hybrid IT
Building Blocks for Hybrid ITRightScale
 
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps Eason Kuo
 
Best Practice In Software Development
Best Practice In Software DevelopmentBest Practice In Software Development
Best Practice In Software DevelopmentSARCCOM
 
DITA Quick Start Webinar: Defining Your Style Sheet Requirements
DITA Quick Start Webinar: Defining Your Style Sheet RequirementsDITA Quick Start Webinar: Defining Your Style Sheet Requirements
DITA Quick Start Webinar: Defining Your Style Sheet RequirementsSuite Solutions
 
DCSF 19 Modern Orchestrated IT for Enterprise CMS
DCSF 19  Modern Orchestrated IT for Enterprise CMSDCSF 19  Modern Orchestrated IT for Enterprise CMS
DCSF 19 Modern Orchestrated IT for Enterprise CMSDocker, Inc.
 

What's hot (14)

Android application development
Android application developmentAndroid application development
Android application development
 
Unlock the Power of Streaming Data with Kinetica and Confluent Platform
Unlock the Power of Streaming Data with Kinetica and Confluent PlatformUnlock the Power of Streaming Data with Kinetica and Confluent Platform
Unlock the Power of Streaming Data with Kinetica and Confluent Platform
 
Monolith to Microservices - O’Reilly Oscon
Monolith to Microservices - O’Reilly OsconMonolith to Microservices - O’Reilly Oscon
Monolith to Microservices - O’Reilly Oscon
 
Why we got to Docker
Why we got to DockerWhy we got to Docker
Why we got to Docker
 
Overview of DITA 1.3
Overview of DITA 1.3Overview of DITA 1.3
Overview of DITA 1.3
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD Course
 
Java Community Webinar #8: “High Performance Systems Design”
Java Community Webinar #8: “High Performance Systems Design”Java Community Webinar #8: “High Performance Systems Design”
Java Community Webinar #8: “High Performance Systems Design”
 
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd mattersDDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
 
The five expertise of a software architect
The five expertise of a software architectThe five expertise of a software architect
The five expertise of a software architect
 
Building Blocks for Hybrid IT
Building Blocks for Hybrid ITBuilding Blocks for Hybrid IT
Building Blocks for Hybrid IT
 
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
 
Best Practice In Software Development
Best Practice In Software DevelopmentBest Practice In Software Development
Best Practice In Software Development
 
DITA Quick Start Webinar: Defining Your Style Sheet Requirements
DITA Quick Start Webinar: Defining Your Style Sheet RequirementsDITA Quick Start Webinar: Defining Your Style Sheet Requirements
DITA Quick Start Webinar: Defining Your Style Sheet Requirements
 
DCSF 19 Modern Orchestrated IT for Enterprise CMS
DCSF 19  Modern Orchestrated IT for Enterprise CMSDCSF 19  Modern Orchestrated IT for Enterprise CMS
DCSF 19 Modern Orchestrated IT for Enterprise CMS
 

Similar to 2019-Nov: Domain Driven Design (DDD) and when not to use it

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
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitectureAshwini Kuntamukkala
 
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...confluent
 
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...confluent
 
SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?Nicolas Georgeault
 
Forge - DevCon 2016: Implementing Rich Applications in the Browser
Forge - DevCon 2016: Implementing Rich Applications in the BrowserForge - DevCon 2016: Implementing Rich Applications in the Browser
Forge - DevCon 2016: Implementing Rich Applications in the BrowserAutodesk
 
It is a sunny day
It is a sunny dayIt is a sunny day
It is a sunny daybcoder
 
Friday final test
Friday final testFriday final test
Friday final testbcoder
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
My Path From Data Engineer to Analytics Engineer
My Path From Data Engineer to Analytics EngineerMy Path From Data Engineer to Analytics Engineer
My Path From Data Engineer to Analytics EngineerGoDataDriven
 
Agile Development – Why requirements matter by Fariz Saracevic
Agile Development – Why requirements matter by Fariz SaracevicAgile Development – Why requirements matter by Fariz Saracevic
Agile Development – Why requirements matter by Fariz SaracevicAgile ME
 
Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...HostedbyConfluent
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Mark Tabladillo
 
Data-Ed: Data Architecture Requirements
Data-Ed: Data Architecture Requirements Data-Ed: Data Architecture Requirements
Data-Ed: Data Architecture Requirements Data Blueprint
 
Data-Ed Online: Data Architecture Requirements
Data-Ed Online: Data Architecture RequirementsData-Ed Online: Data Architecture Requirements
Data-Ed Online: Data Architecture RequirementsDATAVERSITY
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)TIMETOACT GROUP
 

Similar to 2019-Nov: Domain Driven Design (DDD) and when not to use it (20)

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
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
Designing and Implementing Information Systems with Event Modeling, Bobby Cal...
 
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
Building Information Systems using Event Modeling (Bobby Calderwood, Evident ...
 
SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?
 
Forge - DevCon 2016: Implementing Rich Applications in the Browser
Forge - DevCon 2016: Implementing Rich Applications in the BrowserForge - DevCon 2016: Implementing Rich Applications in the Browser
Forge - DevCon 2016: Implementing Rich Applications in the Browser
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 
SharePoint Custom Development
SharePoint Custom DevelopmentSharePoint Custom Development
SharePoint Custom Development
 
It is a sunny day
It is a sunny dayIt is a sunny day
It is a sunny day
 
Friday final test
Friday final testFriday final test
Friday final test
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
My Path From Data Engineer to Analytics Engineer
My Path From Data Engineer to Analytics EngineerMy Path From Data Engineer to Analytics Engineer
My Path From Data Engineer to Analytics Engineer
 
Agile Development – Why requirements matter by Fariz Saracevic
Agile Development – Why requirements matter by Fariz SaracevicAgile Development – Why requirements matter by Fariz Saracevic
Agile Development – Why requirements matter by Fariz Saracevic
 
Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...
 
Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904Managing Enterprise Data Science 201904
Managing Enterprise Data Science 201904
 
Data-Ed: Data Architecture Requirements
Data-Ed: Data Architecture Requirements Data-Ed: Data Architecture Requirements
Data-Ed: Data Architecture Requirements
 
Data-Ed Online: Data Architecture Requirements
Data-Ed Online: Data Architecture RequirementsData-Ed Online: Data Architecture Requirements
Data-Ed Online: Data Architecture Requirements
 
Code or No Code
Code or No CodeCode or No Code
Code or No Code
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
 

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

GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesNeo4j
 
A Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data MigrationA Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data MigrationHelp Desk Migration
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEJelle | Nordend
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfMeon Technology
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
Benefits of Employee Monitoring Software
Benefits of  Employee Monitoring SoftwareBenefits of  Employee Monitoring Software
Benefits of Employee Monitoring SoftwareMera Monitor
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignNeo4j
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
How To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdfHow To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdfayushiqss
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockSkilrock Technologies
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisNeo4j
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationHelp Desk Migration
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
 

Recently uploaded (20)

GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
A Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data MigrationA Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data Migration
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Benefits of Employee Monitoring Software
Benefits of  Employee Monitoring SoftwareBenefits of  Employee Monitoring Software
Benefits of Employee Monitoring Software
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
How To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdfHow To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdf
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 

2019-Nov: Domain Driven Design (DDD) and when not to use it

  • 1. Domain Driven Design And when not to use it Cincinnati SC 2019-11-06 mark@agiledna.com https://github.com/mwindholtz/presentations/DDD-SC-Cinci Wikimedia Commons
  • 2. About me: mark@agiledna.com • Built … • eCommence site for ~12 years • Memberships site for ~8 years • Elixir: CC Processing, Medical Research, Energy Grid • DDD Since 2006 • TDD since 1999 — sUnit • Learned from Kent Beck, Bob Martin, Eric Evans
  • 3. About YOU • What Drives Your Product Code Design?
  • 4. Some Observed Drivers … • UI Screens / API • Database Model • Doing Risk Items First, or Last • Architect’s Personal Issues - opposite of last project • Features, Features, more Features
  • 5. Domain Driven Design, 2003 • Tackling Complexity in the Heart of S/W • By Eric Evans • “The Big Blue Book”
  • 6. Domain-Driven Design (DDD) • For … • complex needs • connects implementation to evolving model • DOMAIN is the problem space • MODEL is an abstracted potential solution • Code is code
  • 7. DDD: From Debt to Dividend • Tech Debt • Paying interest plus principle to temporarily move faster • Tech Dividend • Getting extra value on deep design to unlock extra features
  • 8. DDD is a Set of Principles • Core Domain - focus here • Explore Models in a Collaboration of • Domain experts and the software team • Separate Business from Technical • Speak in a Ubiquitous Language • within a Bounded Context
  • 9. When to Apply Domain Design • For Simple systems • No worries. It fits inside a person’s head. • 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 … ** has an unknown expiration date. ** may also be wrong. **Other restrictions may apply.
  • 10. Warning ! • Simple Systems … • Become Medium System … • Which Become Complex systems
  • 11. Why “Agile” Software becomes a Mess • 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
  • 12. Code Structure: Big Ball Of Mud Process Diagnosis: Featureatitis Design: Preventing ripple effects
  • 13. • Martin Fowler Design Stamina Hypothesis
  • 14. Software Craftsmanship — IS NOT ENOUGH — • Refactoring • Better names • Test Driven Design • Continuous Single Integration • Something is still missing
  • 15. Technical debt isn't technical - Einar Høst - DDD Europe 2019
  • 16. DDD Prerequisites • Close Collaboration of Business • Development in Ubiquitous Language • Iterative Development
  • 17. DDD is Difficult to Explain. Why? • Since the Problem is Complex and Subtle • So is the Solution • Difficult to scale down into examples • Large Vocabulary of Interrelated Patterns • Pattern Languages
  • 18. Doing DDD - mark’s version • Core Domain, and SubDomains • Bounded Contexts • Ubiquitous Language • Building Blocks are Tactical Patterns • Repeat … and Revisit
  • 19. CORE DOMAIN • A System Hard to understand is hard to change • Boil down the MODEL • Skilled developers are drawn to new tech • Get top talent into the CORE DOMAIN
  • 20. Application, as we Imagine it could be
  • 22. Apply strategic patterns to find the Core Domain
  • 23. DDD Topic Areas • Strategic Patterns • Tactical Patterns • Communication Tips
  • 24. Strategic Patterns Finding & Separating The Core Domain Wikimedia Commons
  • 25. Bounded Context • Large projects have multiple Models • Combining Models causes bugs • Model only has meaning in a context • Therefore … • Define the context of the Model • Set boundaries in terms of • parts of the application • team organization • code bases, git-repositories Acme Internet of Things Manager
  • 26. ContextMap • To develop a strategy, we need a large-scale view across our project and others we integrate with. • Therefore … • Describe the points of contact between Models. • Explicit translations • Sharing • Isolation mechanisms • Levels of influence Acme Internet of Things Manager Acme Smoke Detector Network Arrow points downstream data flows Data flows to Manager from Network Smoke detector devices
  • 27. DDD Topic Areas • Strategic Patterns • Tactical Patterns • Communication Tips
  • 28. Tactical Patterns - Building Blocks • Layered Architecture • Aggregates • Value Objects • Entities • Services • Domain Events
  • 29. Layered Architecture Name Description Example UI User Interface or API Web form Json API Application Thin. No Biz Rules. Stateless. Use Cases. Coordinator. Funds Transfer Service Domain Business Concepts, Biz Rules. The heart of the business software. DDD Infrastructure Support for the other layers Pub-Sub DB
  • 30. Aggregates in Layers - 1 Domain Database Application Service UI Gateway to External Services API Domain Database Application Service UI Gateway to External Services API
  • 31. A few other Building Blocks Value Object • Value only { :usd, 1000.00 } { :watt_hours, 900 } Entity • Life Cycle • Has Identity field %Order{ id: 2341334 } %User{ id: 3421424 }
  • 32. Aggregate • Keep them Small • Protect Business Invariants inside Aggregate • Reference Other Aggregates by Identity only • Update other Aggregates with Eventual Consistency •
  • 33. Aggregates in Layers - 2 Domain Database Application Service UI Gateway to External Services API Domain Database Application Service UI Gateway to External Services Aggregate AggregateAggregate Aggregate API
  • 34. Aggregates in Layers - 3 Domain Database Application Service UI Gateway to External Services API Domain Database Application Service UI Gateway to External Services Aggregate API Root
  • 35. Aggregates in Layers - 4 Domain Database Application Service UI Gateway to External Services Event Bus API
  • 36. DDD Topic Areas • Strategic Patterns • Tactical Patterns • Communication Tips
  • 37. Communication Tips • Investigate, question Constraints • Listening for missing Words and Concepts • Ask “Why?” • Event Storming • Whirlpool
  • 41. When to use Full-DDD • Strategic, Tactical, Communication • Increasing complexity is slowing down progress • Defects about fundamental Model are increasing • Edge Cases are increasing
  • 42. When to use Partial-DDD - Strategic • As an Architect • Use Bounded Context to reduce confusion • Context Mapping to see flow of the MODEL • When: more then two main modules
  • 43. When to use Partial-DDD - Tactical • As a Developer: Use Building Blocks • Layered Architecture, Aggregate • TDD • When: Increasing conditional statements • When: DB accessed everywhere, big test setup • When: DB Locking issues
  • 44. When not to use DDD • Simple CRUD / REST application needs • Not using an iterative process • Poor access to Domain Experts • Build and forget apps CRUD => Active Record => Domain Model => DDD - Davin Tryon, via stack overflow
  • 45. Just the beginning … Acme Internet of Things Manager Acme Smoke Detector Network