>
> if you want to tie into the unit of work, then you are looking at NH
> IEventListener implementations or a session interceptor. the event listener
> model is much more flexible. this works for cross cutting concerns like
> logging, auditing, validation, etc. But this approach doesn't make much
> sense in the context you describe.
>
> That leaves domain events.
> class Entity
> {
> public void Reset()
> {
> //yes, this is a static gateway object.
> DomainEvents.Fire(new EntityReset(this));
> }
> }
>
> class SendMessageAfterEntityIsResent
> {
> public SendMessageAfterEntityIsResent(IBus bus)
> {
> }
>
> public void Handel(EntityReset message)
> {
> bus.Send(new Message());
> }
> }
>
> //a very simple implementation
> static class DomainEvents
> {
> public void Fire<T>(T message)
> {
> container.ResolveAll<T>().Each(handler => handler.Handel(message));
> }
> }
>
>
Funny that you mention this as I read this months ago but is not the
solution for our problem as this shares one DomainEvent accross several
SessionFactories and that is problematic.
Do you have other suggestions?
--
Ramon
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.