Skip to content

Hide the EventSink object from EventSourcedAggregate #1

@rkaw92

Description

@rkaw92

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.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions