rails_event_store icon indicating copy to clipboard operation
rails_event_store copied to clipboard

Document how to implement feature with RES ecosystem

Open mostlyobvious opened this issue 7 years ago • 2 comments

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.

mostlyobvious avatar Mar 13 '18 18:03 mostlyobvious

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.

paneq avatar Mar 17 '18 10:03 paneq

@andrzejsliwa was it like that?

paneq avatar Mar 17 '18 10:03 paneq