SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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.
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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)
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
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
 
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
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
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.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
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
 

Kürzlich hochgeladen (20)

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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)
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
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
 
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
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
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...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
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...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
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...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
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
 

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