Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Event Sourcing/DDD framework not polluting domain layer

I am looking for a Java framework/library to perform event sourcing such that my domain modules/layers are not polluted by it or any other framework but that allows me to publish domain events from my aggregates.

I looked at Axon documentation but it works using inheritance over Aggregates and DomainEvents that is not really satisfying.

I attempted to build my own mini-framework based on spring injection and static publishing from aggregates but I am concerned about performance and scalability, therefore I would rather use a bulletproof framework.

like image 884
user2854544 Avatar asked Mar 26 '26 21:03

user2854544


1 Answers

The aggregates are just recording the new change events. They aren't publishing the events themselves so there is nothing complicated there that would require a framework. Events are generally published by the event store through a collaborating service, but you can also do it elsewhere in the processing pipeline (e.g. repository).

Still, I'd recommend you to have an AggregateRoot layer supertype. Have a look at Greg Young's m-r.

like image 135
plalx Avatar answered Mar 29 '26 11:03

plalx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!