Domain-Driven Design
has evolved a lot
in +10 years
Slide 6
Slide 6 text
this talk is about
things processes
the grand dichotomy
Slide 7
Slide 7 text
Great models are
╳ an accurate representation of reality
✓ useful abstractions
✓ solve problems
Slide 8
Slide 8 text
Use heuristics
Slide 9
Slide 9 text
Being
Behaving
Becoming
Inspired by ”Rethinking Systems Analysis and Design” — Gerald M. Weinberg
Slide 10
Slide 10 text
Being
How it is structured
Morphology
Slide 11
Slide 11 text
Behaving
How it reacts to inputs
Repeatable, reversible
Slide 12
Slide 12 text
Becoming
How it changes into something else
Evolution
Slide 13
Slide 13 text
structural modelling
focus on artefacts
Slide 14
Slide 14 text
“As a shopper, in order to buy stuff
Given I have a product X with price EUR100
When I …”
Slide 15
Slide 15 text
“As a shop owner, in order to sell stuff
Given I have a product X,
And that product is priced EUR 100 in the pricing table
When I …”
Slide 16
Slide 16 text
pseudo-behavioural
Slide 17
Slide 17 text
imposes a structural model
Slide 18
Slide 18 text
“As a shopper, in order to buy stuff
Given the shop owner has priced a product X at EUR100
When I …”
Slide 19
Slide 19 text
“Teachers have multiple courses, each with
multiple modules.
Students have multiple courses.”
Slide 20
Slide 20 text
“Courses are only visible when their status is
Approved”
Slide 21
Slide 21 text
What changes?
Why does it change?
Under what circumstances?
Who changes it?
How often does it change?
What are the consequences of that change?
Slide 22
Slide 22 text
Behaving:
“Only committee members can approve courses”
Slide 23
Slide 23 text
Becoming:
“Modules are added and removed”
Slide 24
Slide 24 text
What happens to students who already completed
some of the modules that are now obsolete?
Slide 25
Slide 25 text
time
event sourcing
E E E E E E
A
E = domain event, A = artefact
Slide 26
Slide 26 text
event storming
Slide 27
Slide 27 text
event storming
E
Invoice was paid
time
Slide 28
Slide 28 text
E
C
C = command
Pay for invoice Invoice was paid
time
Slide 29
Slide 29 text
E
C
B = business rule
B
Pay for invoice Invoice was paid
Slide 30
Slide 30 text
E
C B
Invoice was paid
Invoice was partially paid
Pay for invoice
Paid amount < Invoice amount
Paid amount = Invoice amount
Slide 31
Slide 31 text
E
C B
Invoice was paid
Invoice was partially paid
Paid amount < Invoice amount
Paid amount = Invoice amount
Paid amount > Invoice amount
Invoice was overpaid
Slide 32
Slide 32 text
E
C B
= end of lifecycle
Invoice was paid
Slide 33
Slide 33 text
E
C B
= depends on
payment amount
Pay for invoice
Slide 34
Slide 34 text
C B
E
E
invoice amount
Invoice was
created
Slide 35
Slide 35 text
C B
E
C
E
Create invoice
Slide 36
Slide 36 text
C B
E
C
E C B
E
Slide 37
Slide 37 text
C B
E
C
E C B
E
All paid amounts < Invoice amount
All paid amounts = Invoice amount
All paid amounts > Invoice amount
Slide 38
Slide 38 text
C B
E
C
E C B
E
E
Invoice was paid
Invoice was partially paid
Slide 39
Slide 39 text
the primitives
of our model
Slide 40
Slide 40 text
artefacts
relations
+ foo() behaviour
Slide 41
Slide 41 text
time
knowledge
constraints
history
intentions
branches
processes
And more: actors, queries, …