Top Banner
Towards Modelling Processes @ mathiasverraes
68

Towards Modelling Processes

Aug 05, 2015

Download

Software

Mathias Verraes
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Towards Modelling Processes

Towards Modelling Processes@mathiasverraes

Page 2: Towards Modelling Processes

Mathias Verraes verraes.net

@mathiasverraes

Independent Software Consultant

Student of Systems Meddler of Models Labourer of Legacy

Page 3: Towards Modelling Processes

Domain-Driven Design workshops verraes.net/workshops

Page 4: Towards Modelling Processes
Page 5: Towards Modelling Processes

Domain-Driven Design has evolved a lot

in +10 years

Page 6: Towards Modelling Processes

this talk is about

things processes

the grand dichotomy

Page 7: Towards Modelling Processes

Great models are

╳ an accurate representation of reality ✓ useful abstractions ✓ solve problems

Page 8: Towards Modelling Processes

Use heuristics

Page 9: Towards Modelling Processes

Being Behaving Becoming

Inspired by ”Rethinking Systems Analysis and Design” — Gerald M. Weinberg

Page 10: Towards Modelling Processes

Being How it is structured

Morphology

Page 11: Towards Modelling Processes

Behaving How it reacts to inputs Repeatable, reversible

Page 12: Towards Modelling Processes

Becoming How it changes into something else

Evolution

Page 13: Towards Modelling Processes

structural modelling

focus on artefacts

Page 14: Towards Modelling Processes

“As a shopper, in order to buy stuff Given I have a product X with price EUR100

When I …”

Page 15: Towards Modelling Processes

“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 …”

Page 16: Towards Modelling Processes

pseudo-behavioural

Page 17: Towards Modelling Processes

imposes a structural model

Page 18: Towards Modelling Processes

“As a shopper, in order to buy stuff Given the shop owner has priced a product X at EUR100

When I …”

Page 19: Towards Modelling Processes

“Teachers have multiple courses, each with multiple modules.

Students have multiple courses.”

Page 20: Towards Modelling Processes

“Courses are only visible when their status is Approved”

Page 21: Towards Modelling Processes

What changes? Why does it change?

Under what circumstances? Who changes it?

How often does it change?

What are the consequences of that change?

Page 22: Towards Modelling Processes

Behaving: “Only committee members can approve courses”

Page 23: Towards Modelling Processes

Becoming: “Modules are added and removed”

Page 24: Towards Modelling Processes

What happens to students who already completed some of the modules that are now obsolete?

Page 25: Towards Modelling Processes

time

event sourcing

E E E E E E

A

E = domain event, A = artefact

Page 26: Towards Modelling Processes

event storming

Page 27: Towards Modelling Processes

event storming

EInvoice was paid

time

Page 28: Towards Modelling Processes

EC

C = command

Pay for invoice Invoice was paid

time

Page 29: Towards Modelling Processes

EC

B = business rule

BPay for invoice Invoice was paid

Page 30: Towards Modelling Processes

EC B

Invoice was paid

Invoice was partially paidPay for invoice

Paid amount < Invoice amount Paid amount = Invoice amount

Page 31: Towards Modelling Processes

E

C BInvoice was paid

Invoice was partially paid

Paid amount < Invoice amount Paid amount = Invoice amount Paid amount > Invoice amount

Invoice was overpaid

Page 32: Towards Modelling Processes

E

C B

= end of lifecycle

Invoice was paid

Page 33: Towards Modelling Processes

E

C B

= depends on

payment amountPay for invoice

Page 34: Towards Modelling Processes

C BE

E

invoice amount

Invoice was created

Page 35: Towards Modelling Processes

C BEC

ECreate invoice

Page 36: Towards Modelling Processes

C BEC

E C B

E

Page 37: Towards Modelling Processes

C BEC

E C B

E

All paid amounts < Invoice amount All paid amounts = Invoice amount All paid amounts > Invoice amount

Page 38: Towards Modelling Processes

C BEC

E C B

E

E

Invoice was paidInvoice was partially paid

Page 39: Towards Modelling Processes

the primitives of our model

Page 40: Towards Modelling Processes

artefacts

relations

+ foo() behaviour

Page 41: Towards Modelling Processes

timeknowledge

constraints history

intentions branches

processes

And more: actors, queries, …

Page 42: Towards Modelling Processes

going further…

actors queries

immediate consistency eventual consistency

aggregates

Page 43: Towards Modelling Processes

“Neither a static view nor a dynamic view

can be the whole view.”

Gerald M. Weinberg — Rethinking Systems Analysis and Design

Page 44: Towards Modelling Processes

E E E E

A

E E E E

process process

Page 45: Towards Modelling Processes

E E E E E E E E

collaborative construction executionartefact

process process

Page 46: Towards Modelling Processes

E E E E E E E E

becoming being behaving

Page 47: Towards Modelling Processes

invoice drafting

invoice documentinvoicing process

Page 48: Towards Modelling Processes

invoice drafting

invoice documentinvoicing process

the artefact prescribes the execution process

Page 49: Towards Modelling Processes

orderingreceipt

receiving & putaway

Page 50: Towards Modelling Processes

negotiationinsurance contract

claim

Page 51: Towards Modelling Processes

collaborative construction executionartefact

Page 52: Towards Modelling Processes

collaborative construction executionartefact

analysis

tracking

feedback

Page 53: Towards Modelling Processes

invoice drafting

invoice documentinvoicing process

implicit internal policy

Page 54: Towards Modelling Processes

invoice drafting

invoice documentinvoicing process

explicit policy

Page 55: Towards Modelling Processes

invoice drafting

invoice documentinvoicing process

evolving policy

Page 56: Towards Modelling Processes

invoice drafting

invoice documentinvoicing process

evolving policy

Page 57: Towards Modelling Processes

configurable policies per tenant

orderingreceipt

receiving & putaway

Page 58: Towards Modelling Processes

product changes

negotiationinsurance contract

claim

internal policy

Page 59: Towards Modelling Processes

implementation suggestions

Page 60: Towards Modelling Processes

Processes with:

Immediately consistent rules => aggregates

Eventually consistent rules => process managers

Page 61: Towards Modelling Processes

1 2 3 4

policy changes

Versioning

2

E E EB B

1 2 3 4

2 2

Page 62: Towards Modelling Processes

E E E

1 2 3 4

policy changes

Specification

B B

Page 63: Towards Modelling Processes

E E E

1 2 3 4

policy changes

Specification

B B

auditing

Page 64: Towards Modelling Processes

E E E

1 2 3 4

policy changes

Strategy

B B

Page 65: Towards Modelling Processes

E E E

1 2 3 4

policy changes

Running process affected by policy changes

B B

Page 66: Towards Modelling Processes

complex business problems require a

temporal model

Page 67: Towards Modelling Processes

“The only reason

for time is so that

everything doesn’t happen

at once.”

Albert Einstein

Page 68: Towards Modelling Processes

@mathiasverraes verraes.net

dddeurope.com Brussels, January 2016