-
Notifications
You must be signed in to change notification settings - Fork 3
Reflect-based aggregate system. #10
Comments
I've been thinking about how this will work a little more, specifically in regards to autowiring the saga instance mapping, that is, the logic that determines which saga instance a message is routed to. For a "hand rolled" saga, this is achieved by the two With aggregates, we always want to select an instance directly by its ID (which, by the way, means that the "aggregate ID" is one and the same as the "saga instance ID"). The The I'll put forth a few options on how this might be done: 1. Add a method to the message itselfIn the early The benefit of this approach is that it localises the message-type-specific logic to the message itself. However, I've steered clear of this in Not only that, but since these messages are the public API, it might be logical to place their definition in some shared library that is consumed by multiple endpoints. It'd be a pain to require a new version of that shared library just because some routing rules/implementation details change. 2. Require the user to implement
|
This is going to require a change to the This is because we want to allow users to write |
…r than the data. This is in preparation for #10, which requires separation of the event handling and the data instance.
This turned out to be quite easy, see #62. |
I've made a quick PR for this (#63) -- I went with option 4. from the list above for the mapping strategies. I've only implemented support for the "field name" strategy at the moment, you can see how that's configured by the user here at the bottom of the account example. |
Fixed by #63 |
Aggregates are a specialization of sagas that can only handle commands and produce events.
Reflection would be used to wire up an implementation of
saga.Saga
based on the methods of an "aggregate". This would be a return to the "magic" from early prototypes ofdogma
(When
andDo
methods).The text was updated successfully, but these errors were encountered: