Hello,
I have been reading about Domain Events and have seen codes from Udi's implementation(http://www.udidahan.com/2009/06/14/domain-events-salvation/) ,Mike Hadlow (http://mikehadlow.blogspot.com/2010/09/separation-of-concerns-with-domain.html), Jimmy Bogard and Jason Dentler's implementation.
All in All I like the idea of events.
My questions is which later should I add these components.
I am not going to use any BUS and all events will be handled in Synchronous fashion.
I guess the interface IDomainEvent , IEventHandler should go in Project.Core where rest of the interfaces are kept and accessed by all projects.
The Dispatcher ( which is a static class) I believe should go into Project.Infrastructure
I will create a new Project just for Handlers of domain events. lets say Project.EventHandlers
I will use IoC (structuremap) to register all handlers.
The Events themselves as I see are based on Business Language and for that reason I believe should go to Project.Domain where all Aggregates are implemented.
Let me know if this is the right way.
My other confusion is on project references. Should Project.Domain reference Project.Infrastructure so that it can use the static Event Dispatcher
Should Project.EventHandlers reference Project.Domain because It needs to know what events are there that can be handled.
I am planning to create a StructureMap Registry class in Project.EventHandlers that will be then BootStrapped in Global.asax
If this has been talked before please point me to the link. I couldn't find one through Google Searches
Please advise.
Mar