In all the examples of CQRS I've seen, the domain events trigger updates to the read model but nothing else. But what about when you want a domain event to cause other changes in the domain?
For example, assume you have the following requirements:
What's the best way to handle this?
There's a specific concept called Sagas for this exact purpose. Start with this article by Rinat Abdullin, then go from there.
https://blog.jonathanoliver.com/cqrs-sagas-with-event-sourcing-part-i-of-ii/
Your option 3 comes close to this concept. A saga is basically an event handler that issues new commands. You wouldn't want to have an event manipulate aggregates outside the one it originates from but rather handle the event and submit new commands according to your business rules. This is what the saga will do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With