EventFlow
EventFlow copied to clipboard
Separating events and aggregates
I would like to house my Events
in a separate project from my Aggregates
. I plan to have event handlers running on various microservices and it would be nice if I could share the Events
library without necessarily sharing the whole domain implementation. Unfortunately this currently creates circular dependency since, my Aggregates
obviously need to know about the Events
and for some reason my Events
need to know what Aggregate
they were raised by.
Is there any reason why an Event
can't just be a really simple, dumb object akin to a DTO? I don't understand why an Event
would need to know what Aggregate
it was raised by.
Great question. This doesn't make sense to me either.
Maybe it would be sufficient to define interfaces on top of entities and just share the interfaces with the events together? Therefore it would not be necessary to share the entity itself. Not sure whether it would work indeed. regards
The reason for the reference in the interface is to make all the generics "link" (lack a better word) and make sure you don't have to upcast in your code. However, I agree it would be a nice cleanup if the amount of arguments to generics could be a bit more loose, but I think this would require a large set of breaking changes and not something I think I would do for a version 1.0
@rasmus I have exactly the same issue. What would you suggest for the time being?
@rsmythe did you end up with something workable?
Hello there!
We hope you are doing well. We noticed that this issue has not seen any activity in the past 90 days. We consider this issue to be stale and will be closing it within the next seven days.
If you still require assistance with this issue, please feel free to reopen it or create a new issue.
Thank you for your understanding and cooperation.
Best regards, EventFlow
Hello there!
This issue has been closed due to inactivity for seven days. If you believe this issue still needs attention, please feel free to open a new issue or comment on this one to request its reopening.
Thank you for your contribution to this repository.
Best regards, EventFlow