SlideShare a Scribd company logo
JakubPilimon
pilo_dev
pilloPl
DOMAIN-DRIVEN DESIGN
THEORY VS PRACTICE
NO UPFRONT DEFINISIONS
DOMAIN-DRIVEN DESIGN?
DDD?
CLEAN CODE?
CLEAN ARCHITECTURE?
CLEAN MODEL?
WHAT IS A MODEL?
INFORMATION GATHERING
MODULARIZATION
EVENT STORMING
EVENT
EVENT EVENT EVENT
PIVOTAL EVENTS
WHAT IS „A DOCUMENT”?
A RICH OBJECT
AN ANEMIC OBJECT
A COMPRESSED DATA
BOUNDED CONTEXT
WHAT IS „A POLICY”?
PIVOTAL EVENTS
OTHER HEURISTICS
LANGUAGE
DEPARTAMENTS
SINGLE SOURCE OF TRUTH
GENERIC AND CORE
PROBLEMS
WHAT KIND OF CODE IS INA
BOUNDED CONTEXT?
WHAT IS AN AGGREGATE?
UNDERSTAND DIFFERENT
TYPES OF LOGIC
SpringOne Tour: Domain-Driven Design: Theory vs Practice
„Can’t spend more money
than you have”
AGGREGATE
COMMAND
CONSISTENCY
„After charging a payer, an
external legacy system must
be informed (unless it is
Friday)”
AGGREGATE
APPLICATION
SERVICE
INTEGRATION/APPLICATION
EXTERNAL
SYSTEM
„ISBN must be correct”
VALIDATION
COMMAND
API
„Order forms are grouped
into packages”
ASK QUESTION: „WHAT DOES IT
CHANGE?”
ORDER
ADDED TO
PACKAGE
ORDER
REMOVED TO
PACKAGE
SO WHAT? WHAT
HAS HAPPENED?
PRESENTATION LOGIC
READ MODEL
ASK QUESTION: „WHAT DOES IT
CHANGE?”
ORDER
ADDED TO
PACKAGE
ORDER
REMOVED TO
PACKAGE
ASSISTANT
(ASSIGNED TO
THE PACKAGE)
NOW HAS
PERMISSION TO
ALL THE FORMS
PERMISSION
TO FORMS
GRANTED
SLICING A PROCESS DOES
NOT ALWAYS WORK
E-Scooter riders place reservations.
Reservation contains a particular e-scooter’s id,
rider’s id and it’s valid for a speci
fi
c amount of time.
There can be only one reservation for a particular
e-scooter at any given point of time.
New reservations are active by default. They can
expire or be canceled.
E-Scooters must be maintained (for instance -
battery replacement)
E-scooters that are put into maintenance mode
can’t be reserved.
E-scooters which are reserved can’t be put into
maintenance mode
Sometimes we predict high demand for e-
scooters in particular zones (areas).
They are delivered to the zone and can’t be
reserved by riders until speci
fi
c time (can’t be
put into maintenance mode either)
We can’t use scooter for a demand if it is
reserved or currently in maintenance.
E-SCOOTER
SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DEMAND
(requested?)
E-SCOOTER
SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
E-SCOOTER
SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
Block
Block
Block
DEMAND
SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
Blocked
Change description
POOR SCALABILITY
OR INCONSISTENCY
POOR TESTABILITY
COGNITIVE LOAD
DISPLAY
READY TO
RIDE
E-SCOOTERS
MAP SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
PROBLEMATIC TEAM
DEPENDENCIES
HOW MANY TEAMS GET A
TASK TO DELIVER THAT
STORY?
MAP SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
DRY
(LOGIC, NOT CODE!)
COUPLING
MAP SERVICE
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
E-SCOOTER
SERVICE
LOGICAL COUPLING
E-SCOOTER
SERVICE isAvailable?
RESERVATION
(placed?)
E-SCOOTER
(under
maintenance?)
DE
DEMAND
(requested?)
Availability Model
E-SCOOTER
SERVICE
Implementation
detail
Implementation
detail
DE
Implementation
detail
OBSERVABLE
BEHAVIOR
E-SCOOTER
SERVICE
Implementation
detail
Implementation
detail
DE
Implementation
detail
OBSERVABLE
BEHAVIOR
MAP SERVICE
COUPLING TO
OBSERVABLE BEHAVIORS
COUPLING TO
IMPLEMENTATION DETAILS
CONTENT COUPLING
INFORMATION HIDING
HOW TO NOTICE IT IN
YOUR PROJECT?
ASK QUESTION: „WHAT DOES IT
CHANGE?”
RESERVATION
COMPLETED
E-SCOOTER
PUT INTO
MAINTAINEN
ACE MODE
DEMAND
REQUESTED
STATUS IN DB
CHANGED
THERE IS
RESERVATION
RECORD
ASK QUESTION: „WHAT DOES IT
CHANGE?”
RESERVATION
COMPLETED
E-SCOOTER
PUT INTO
MAINTAINEN
ACE MODE
DEMAND
REQUESTED
E-SCOOTER
UNAVAILABLE
ASK QUESTION: „WHAT ELSE CAN
HAVE THE SAME RESULT?”
RESERVATION
COMPLETED
E-SCOOTER
UNAVAILABLE
„DON’T COMPLICATE!”
„COMPLICATION” LEADS
TO PROPER
ABSTRACTIONS
E-SCOOTER
SERVICE
Implementation
detail - reason
Implementation
detail - reason
DE
Implementation
detail - reason
OBSERVABLE
BEHAVIOR
MAP SERVICE
RESERVATION
AND RIDING
MAINTENANCE DE
DEMAND
FORECAST
AVAILABILITY
UNDERSTAND UPSTREAM
VS DOWNSTREAM
SINGLE SOURCE OF
TRUTH
LOCATION
AVAILABILITY
Is it available? Where is it?
Take/release
Register
position
COHESION
NOT JUST LOGICAL
COHESION
Location Availability
E-Scooter E-Scooter
position takenTill
LOCATION
AVAILABILITY
DEMAND
REQUESTED
DEMAND
CANCELED
RESERVATION
COMPLETED
RESERVATION
CANCELED
RESERVATION
EXPIRED
PUT INTO
MAINTAINENC
E MODE
LOCATION
AVAILABILITY
SCOOTER
TAKEN/
RELEASED
DEMAND
…
RESERV
ATION…
UNDERSTAND PUBLISHED
VS PUBLIC
BE LIBERAL INSIDE,
STRICT ON THE OUTSIDE
E-Scooter riders place reservations.
Reservation contains a particular e-scooter’s id,
rider’s id and it’s valid for a speci
fi
c amount of time.
There can be only one reservation for a particular
e-scooter at any given point of time.
New reservations are active by default. They can
expire or be canceled.
WHAT IS A
„RESERVATION?”
RESERVATION
COMPLETED
E-SCOOTER
UNAVAILABLE
E-SCOOTER RESERVATION
JUST A CONSEQUENCE
DECISION EFFECT OF THE DECISION
AGGREGATE READ MODEL
FIND REAL CONCEPTS/
ABSTRACTIONS
OFTENTIMES USER
STORIES ARE JUST FULL
OF UI CONCEPTS
USER STORIES ARE JUST
THE BEGINNING OF A
CONVERSATION
JakubPilimon
pilo_dev
pilloPl
DOMAIN-DRIVEN DESIGN
THEORY VS PRACTICE

More Related Content

PDF
Evolving big microservice architectures
PDF
Forklift free production
PPT
Symbology mediation
PPTX
IMC Summit 2016 Breakout - Aleksandar Seovic - The Illusion of Statelessness
PDF
Software Architecture Anti-Patterns
PDF
Sidecars
PDF
Microservices architecture: practical aspects
PDF
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
Evolving big microservice architectures
Forklift free production
Symbology mediation
IMC Summit 2016 Breakout - Aleksandar Seovic - The Illusion of Statelessness
Software Architecture Anti-Patterns
Sidecars
Microservices architecture: practical aspects
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...

Similar to SpringOne Tour: Domain-Driven Design: Theory vs Practice (20)

PPTX
Kakfa summit london 2019 - the art of the event-streaming app
PPTX
Problems you’ll face in the Microservices World: Configuration, Authenticatio...
PPTX
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
PDF
Herding Microservices – the Atlassian Way
KEY
Deploying Next Gen Systems with Zero Downtime
PDF
XebiCon'17 : Monolith to microservice, histoire d’une transformation centrée...
PDF
Lost in transaction - Strategies to deal with (in)consistency in distributed ...
PDF
Domain Event - The Hidden Gem of DDD
PPTX
Exponential-e | Cloud Revolution Seminar at the Ritz, 20th November 2014
PDF
DDD Europe 2019: Lost in transaction
PDF
The Road To Event-Driven Architecture
PDF
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
PDF
[Practical] Functional Programming in Rails
PDF
Introduction-to-Service-Mesh-with-Istio-and-Kiali-OSS-Japan-July-2019.pdf
PDF
Introduction-to-Service-Mesh-with-Istio-and-Kiali-OSS-Japan-July-2019.pdf
PDF
Cloudify your applications: microservices and beyond
PDF
HERE Mobility SDK Tutorial
PDF
Hong Kong User Group 2019
PPTX
Portal apps (slt)
PDF
Service Mesh @Lara Camp Myanmar - 02 Sep,2023
Kakfa summit london 2019 - the art of the event-streaming app
Problems you’ll face in the Microservices World: Configuration, Authenticatio...
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Herding Microservices – the Atlassian Way
Deploying Next Gen Systems with Zero Downtime
XebiCon'17 : Monolith to microservice, histoire d’une transformation centrée...
Lost in transaction - Strategies to deal with (in)consistency in distributed ...
Domain Event - The Hidden Gem of DDD
Exponential-e | Cloud Revolution Seminar at the Ritz, 20th November 2014
DDD Europe 2019: Lost in transaction
The Road To Event-Driven Architecture
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
[Practical] Functional Programming in Rails
Introduction-to-Service-Mesh-with-Istio-and-Kiali-OSS-Japan-July-2019.pdf
Introduction-to-Service-Mesh-with-Istio-and-Kiali-OSS-Japan-July-2019.pdf
Cloudify your applications: microservices and beyond
HERE Mobility SDK Tutorial
Hong Kong User Group 2019
Portal apps (slt)
Service Mesh @Lara Camp Myanmar - 02 Sep,2023
Ad

More from VMware Tanzu (20)

PDF
Spring into AI presented by Dan Vega 5/14
PDF
What AI Means For Your Product Strategy And What To Do About It
PDF
Make the Right Thing the Obvious Thing at Cardinal Health 2023
PPTX
Enhancing DevEx and Simplifying Operations at Scale
PDF
Spring Update | July 2023
PPTX
Platforms, Platform Engineering, & Platform as a Product
PPTX
Building Cloud Ready Apps
PDF
Spring Boot 3 And Beyond
PDF
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
PDF
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
PDF
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
PPTX
tanzu_developer_connect.pptx
PDF
Tanzu Virtual Developer Connect Workshop - French
PDF
Tanzu Developer Connect Workshop - English
PDF
Virtual Developer Connect Workshop - English
PDF
Tanzu Developer Connect - French
PDF
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
PDF
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
PDF
SpringOne Tour: The Influential Software Engineer
PDF
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
Spring into AI presented by Dan Vega 5/14
What AI Means For Your Product Strategy And What To Do About It
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Enhancing DevEx and Simplifying Operations at Scale
Spring Update | July 2023
Platforms, Platform Engineering, & Platform as a Product
Building Cloud Ready Apps
Spring Boot 3 And Beyond
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
tanzu_developer_connect.pptx
Tanzu Virtual Developer Connect Workshop - French
Tanzu Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
Tanzu Developer Connect - French
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
Ad

Recently uploaded (20)

PPT
Introduction Database Management System for Course Database
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PPTX
Essential Infomation Tech presentation.pptx
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
medical staffing services at VALiNTRY
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Complete React Javascript Course Syllabus.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction Database Management System for Course Database
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
ManageIQ - Sprint 268 Review - Slide Deck
Essential Infomation Tech presentation.pptx
ISO 45001 Occupational Health and Safety Management System
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Wondershare Filmora 15 Crack With Activation Key [2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
medical staffing services at VALiNTRY
Design an Analysis of Algorithms II-SECS-1021-03
Digital Strategies for Manufacturing Companies
Odoo POS Development Services by CandidRoot Solutions
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
2025 Textile ERP Trends: SAP, Odoo & Oracle
Complete React Javascript Course Syllabus.pdf
Softaken Excel to vCard Converter Software.pdf
ai tools demonstartion for schools and inter college
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
VVF-Customer-Presentation2025-Ver1.9.pptx

SpringOne Tour: Domain-Driven Design: Theory vs Practice