rails_event_store
rails_event_store copied to clipboard
Document how to implement feature with RES ecosystem
Andrzej told me once how he introduced new developer to RES-backed system. It sounded well-thought and started with defining Command, through Command handler, publishing Events and lastly implementing Event handler, all test-driven.
While it may differ from case-to-case, there's definitely some typical flow that could become a habit.
Not strictly RES-related but when @andrzejsliwa told me about It felt like a great idea if adapted to RES tooling. Would love more input as I don't quite remember all details form that story now.
From top down:
- controller creates a command
- a command is passed down to command_bus/application service
- service loads an aggregate and calls a method, stores the events
- aggregate verifies preconditions/rules and generates events
- event(s) are passed to event handlers
- event handlers trigger side-effects (email) and/or build read-models.
@andrzejsliwa was it like that?