(src: https://www.youtube.com/watch?v=9ZgSz6xAfL8)
Model: Clue Bucket (aka toolbox)
Model: Patterns vs Principles vs Heuristics
Model: distill your heuristics
Heuristic: things that change together should stay together
- named: Single Responsibility
Model: Method for deliberate design choices
Exercise
Exercise: Which attributes should be in this domain event?
- who placed it
- when was it placed
- Heuristic: when did something happen, is that relevant?
- Heuristic: what are all the timestamps that matter
- when it happened
- when we learned about it
- when we recorded it
- pre-dated
- who cares about this? what do they need
- what was ordered
heuristics for deciding what to put in there
-
always verify assumptions about time
- consumer sees it immediately or later
- data could change over time
- what if a constraint / business rule / invariant is not met immediately but some time goes by
-
redundancy
- minimal events
- Model: Fat events
- Heuristic: consumer might not listen to all events
- Heuristic: immutable attributes we should probably add in there
- mutable: name
- immutable: customer_id
-
consumer
-
Heuristic: serve the consumers needs
-
Heuristic: ignore individual consumer’s needs
-
Heuristic: 80-20 the consumers needs
-
DDD context mapping patterns
-
Pattern: internal to our bounded context, easily changeable
-
Pattern: conformist: leak into my domain
-
Pattern: partnership: their success relies on our success
-
Pattern: open host service (eg. Google Maps)
-
how many consumers are there
- 1
- 5-10 consumers -> 80-20 rule?
-
-
Temporal Coupling
- are the consumers gonna query us to get more data
- Distinction: Notification vs Domain Event
- temporal coupling:
- “This system needs to be online at the time that the consumer wants to know what the order was like”
- reduces our autonomy
- if not online, I can’t do anything
-
Heuristic: sensitive information
- Datasparsamheid
- GDPR compliance
- sensitive information
-
Heuristic: how would it look in a paper world?
-
Heuristic: can we do multiple events for the same event, specific per consumer
Heuristic: if you can imagine it as a 3rd party system, then you can have it as a bounded context
Distinction: Notification vs Domain Event - forces a lookup Model: Domain Event - completeness guarantee Model: Fat events - redundant information
- safe, immutable, stable
- evolve over time, mutable
- sensitive information, supposed to throw away after a certain amount of time
Backlinks
- Session: Design Heuristics
- Distinction: Notification vs Domain Event
- Model: competing heuristics
- Model: distill your heuristics
- Model: Fat events
- Model: Method for deliberate design choices
- Model: Patterns vs Principles vs Heuristics
- Heuristic: when you find a cyclic dependency go get a senior developer
- Model: Clue Bucket (aka toolbox)
- Model: Domain Event