views:

36

answers:

1

What is the best way to implement notification in a C# web application? If this was an EAI BPEL application, I would be using the notification feature within the BPEL specifications to emit events at key tasks I want to monitor. Since this is a C# web application, what are the architectural options? Should I drop messages via pub/sub using NServiceBus at points I want to monitor or should I use .Net event handling to attach to methods I care about or a mixture of both or is there an option I'm not aware of. The case I'm trying to optimize is the least amount of code with the maximum flexibility and scalability.

A: 

The event aggregator pattern is a great one to use for things like this:

http://martinfowler.com/eaaDev/EventAggregator.html

You can check out the kigg project:

http://kigg.codeplex.com/

It has a pretty decent implementation. I think they could improve it a little but overall I like it.

spinon
Would you back up the eventHander with NServiceBus?
Albert T. Wong
@Albert to be honest I had never heard of nservicebus before but it looks good. But I wouldn't be able to comment intelligently about whether to use it or not.
spinon
It's a way to do publish/subscribe using MQ based messaging.
Albert T. Wong
Can you give me an example of what the workflow would be from start to finish?
spinon