Slide 1

Slide 1 text

Towards Modelling Processes @mathiasverraes

Slide 2

Slide 2 text

Mathias Verraes verraes.net @mathiasverraes Independent Software Consultant Student of Systems Meddler of Models Labourer of Legacy

Slide 3

Slide 3 text

Domain-Driven Design workshops verraes.net/workshops

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

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, …

Slide 42

Slide 42 text

going further… actors queries immediate consistency eventual consistency aggregates

Slide 43

Slide 43 text

“Neither a static view nor a dynamic view can be the whole view.” Gerald M. Weinberg — Rethinking Systems Analysis and Design

Slide 44

Slide 44 text

E E E E A E E E E process process

Slide 45

Slide 45 text

E E E E E E E E collaborative construction execution artefact process process

Slide 46

Slide 46 text

E E E E E E E E becoming being behaving

Slide 47

Slide 47 text

invoice drafting invoice document invoicing process

Slide 48

Slide 48 text

invoice drafting invoice document invoicing process the artefact prescribes the execution process

Slide 49

Slide 49 text

ordering receipt receiving & putaway

Slide 50

Slide 50 text

negotiation insurance contract claim

Slide 51

Slide 51 text

collaborative construction execution artefact

Slide 52

Slide 52 text

collaborative construction execution artefact analysis tracking feedback

Slide 53

Slide 53 text

invoice drafting invoice document invoicing process implicit internal policy

Slide 54

Slide 54 text

invoice drafting invoice document invoicing process explicit policy

Slide 55

Slide 55 text

invoice drafting invoice document invoicing process evolving policy

Slide 56

Slide 56 text

invoice drafting invoice document invoicing process evolving policy

Slide 57

Slide 57 text

configurable policies per tenant ordering receipt receiving & putaway

Slide 58

Slide 58 text

product changes negotiation insurance contract claim internal policy

Slide 59

Slide 59 text

implementation suggestions

Slide 60

Slide 60 text

Processes with: Immediately consistent rules => aggregates Eventually consistent rules => process managers

Slide 61

Slide 61 text

1 2 3 4 policy changes Versioning 2 E E E B B 1 2 3 4 2 2

Slide 62

Slide 62 text

E E E 1 2 3 4 policy changes Specification B B

Slide 63

Slide 63 text

E E E 1 2 3 4 policy changes Specification B B auditing

Slide 64

Slide 64 text

E E E 1 2 3 4 policy changes Strategy B B

Slide 65

Slide 65 text

E E E 1 2 3 4 policy changes Running process affected by policy changes B B

Slide 66

Slide 66 text

complex business problems require a temporal model

Slide 67

Slide 67 text

“The only reason for time is so that everything doesn’t happen at once.” Albert Einstein

Slide 68

Slide 68 text

@mathiasverraes verraes.net dddeurope.com Brussels, January 2016