This repository contains the example code to my talk I have given at Domain-Driven Design Europe '22. I recommend giving the slides a look before diving into the repository.
It shows how one can use the mathematical definition of a Transducer, decompose it to its individual parts and create a functional DDD Aggregate implementation.
- JVM 11+
- SBT 1.6+
I recommend firing up the debugger and making breakpoints wherever you want to get an idea of how the examples work.
- Simple state store with a regular state machine
- State store & Event publishing through Transactional Outbox
- Event-Sourcing
- Read-Model projection
- Various Error scenarios
The main point here is that in order to implement all these different use-cases, you don't have to change the model at all. We can just use composition to create use-cases of any complexity.
- Domain model
- Behaviors
- Events
- Required implicit instances
- Read model
- Type aliases
- Generation of State Machine & Transducer based Aggregates
Feedback is very welcome! Let me know if you find something that can be improved or is hard to understand.