EventFlow icon indicating copy to clipboard operation
EventFlow copied to clipboard

Separating events and aggregates

Open rsmythe opened this issue 6 years ago • 5 comments

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.

rsmythe avatar Mar 01 '19 23:03 rsmythe

Great question. This doesn't make sense to me either.

jediwarpraptor avatar Mar 06 '19 20:03 jediwarpraptor

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

kwemou avatar Mar 13 '19 15:03 kwemou

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 avatar Mar 13 '19 18:03 rasmus

@rasmus I have exactly the same issue. What would you suggest for the time being?

promontis avatar Oct 08 '19 18:10 promontis

@rsmythe did you end up with something workable?

promontis avatar Oct 08 '19 18:10 promontis

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

github-actions[bot] avatar Apr 08 '23 13:04 github-actions[bot]

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

github-actions[bot] avatar Apr 16 '23 09:04 github-actions[bot]