domain-events

Persistence and Domain Events with persistence ignorant objects

一个人想着一个人 提交于 2019-12-03 07:50:49
问题 I've been studying on domain driven design in conjunction with domain events. I really like the separations of concerns those events provide. I ran into an issue with the order of persisting a domain object and raising domain events. I would like to raise events in the domain objects, yet I want them to be persistence ignorant. I've created a basic ShoppingCartService , with this Checkout method: public void Checkout(IEnumerable<ShoppingCartItem> cart, Customer customer) { var order = new

Where to raise persistence-dependent domain events - service, repository, or UI?

孤者浪人 提交于 2019-12-03 03:37:13
问题 My ASP.NET MVC3 / NHibernate application has a requirement to fire off and handle a variety of events related to my domain objects. For example, an Order object might have events like OrderStatusChanged or NoteCreatedForOrder . In most cases these events result in an email being sent, so I can't just leave them in the MVC app. I've read through Udi Dahan's Domain Events and dozens of other thoughts on how to do this sort of thing, and I decided on using an NServiceBus-based host that handles

Using Autofac with Domain Events

穿精又带淫゛_ 提交于 2019-12-03 02:54:00
问题 I'm trying to introduce domain events into a project. The concept is described in Udi Dahan's post - http://www.udidahan.com/2009/06/14/domain-events-salvation/ Here's the domain event code public interface IDomainEvent { } public interface IHandleDomainEvents<T> where T : IDomainEvent { void Handle(T args); } public interface IEventDispatcher { void Dispatch<TEvent>(TEvent eventToDispatch) where TEvent : IDomainEvent; } public static class DomainEvents { public static IEventDispatcher

Where to raise persistence-dependent domain events - service, repository, or UI?

两盒软妹~` 提交于 2019-12-02 17:05:46
My ASP.NET MVC3 / NHibernate application has a requirement to fire off and handle a variety of events related to my domain objects. For example, an Order object might have events like OrderStatusChanged or NoteCreatedForOrder . In most cases these events result in an email being sent, so I can't just leave them in the MVC app. I've read through Udi Dahan's Domain Events and dozens of other thoughts on how to do this sort of thing, and I decided on using an NServiceBus-based host that handles event messages. I've done a few proof-of-concept tests and this seems to work well. My question is what

Using Ninject with Udi Dahan's Domain Events

a 夏天 提交于 2019-11-30 22:01:10
I'm using Ninject in an MVC project and am trying to implement Domain Events following Udi Dahan's pattern http://www.udidahan.com/2009/06/14/domain-events-salvation/ In the extract below, the "Container" is used to resolve all the event-handlers for the particular type of event that has been raised. My question (& apologies if I am missing something basic) is how to do this with Ninject? In other words: How does the "Container" get set in this static class? Once I have a Container (Kernel?) what would be the Ninject syntax to resolve all the event handlers (which I'm assuming I would have to

Using Ninject with Udi Dahan's Domain Events

情到浓时终转凉″ 提交于 2019-11-30 17:24:55
问题 I'm using Ninject in an MVC project and am trying to implement Domain Events following Udi Dahan's pattern http://www.udidahan.com/2009/06/14/domain-events-salvation/ In the extract below, the "Container" is used to resolve all the event-handlers for the particular type of event that has been raised. My question (& apologies if I am missing something basic) is how to do this with Ninject? In other words: How does the "Container" get set in this static class? Once I have a Container (Kernel?)

Communicating between two Bounded Contexts in DDD

落花浮王杯 提交于 2019-11-27 00:33:17
I have few different Bounded Contexts in the domain. The validation of a CRUD operation is built in each Bounded Context. For example, I can create an entity called GAME only if the person creating it is a Group Leader . I have two Bounded Contexts (BC) in this example. One is the Game BC and the other is the User BC . To solve the problem, in the Game BC , I have to make a domain service call like IsGroupLeader() to the User BC before proceeding on creating the Game. I don't think this type of communication is recommended by DDD. I can have a User entity also in the Game BC , but I don't want

Communicating between two Bounded Contexts in DDD

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 10:31:49
问题 I have few different Bounded Contexts in the domain. The validation of a CRUD operation is built in each Bounded Context. For example, I can create an entity called GAME only if the person creating it is a Group Leader . I have two Bounded Contexts (BC) in this example. One is the Game BC and the other is the User BC . To solve the problem, in the Game BC , I have to make a domain service call like IsGroupLeader() to the User BC before proceeding on creating the Game. I don\'t think this type