-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
In EventSourcedAggregate, the only functionality which is really used from the EventSink is EventSink#sink(). Thus, no access to the whole object is required.
Passing a sink() function into the EventSourcedAggregate provides better isolation of concerns and allows upper layers (the loader or tryWith) to easier wrap the sink function and provide extra functionality.
A refactoring of how the sink function is passed may also be in order. Right now, it is set after aggregate creation by a setter function. A better solution may be passing the sink function every time commit() is called on the EventSourcedAggregate. This would allow much greater dynamicity of sink() wrappers.
Reactions are currently unavailable