Where to raise persistence-dependent domain events - service, repository, or UI?
问题 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