Aggregates Composition: A new view on Aggregates
summary
Presents a concrete decider pattern implemented in F# with decide/evolve/initial/terminal functions, an in-memory runner for quick staging, and an ES-KV toy used to persist state or switch to event sourcing without changing domain code. Shows tests-as-behaviour, a 2,000-line real decider example converted to 11,000 PHP, optimistic concurrency via e-tags, and a generic compose function that folds multiple deciders (cat + bulb) into one decider so composition is monoidal and works with processes that emit commands.
AI-written summary · about
chapters (14)
- 0:00Introduction and context
- 1:05Problem with aggregates definition
- 3:14Introducing decider pattern
- 9:23Writing domain code example
- 12:58Testing decider logic
- 16:47Running decider in memory
- 20:49Persisting state with key-value store
- 25:18Implementing event sourcing
- 31:55Composing deciders together
- 38:48Demo of composed deciders
- 41:43Scaling with multiple instances
- 43:08Combining processes and deciders
- 47:03Demo of process integration
- 50:41Final demo and summary
