SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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.
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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)
 

Mais de 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
 

Mais de 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
 

Último

Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
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.
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
(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
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Último (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
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...
 
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...
 
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...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
(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...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 

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