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:
It has a pretty decent implementation. I think they could improve it a little but overall I like it.
spinon
2010-07-27 22:14:52
Would you back up the eventHander with NServiceBus?
Albert T. Wong
2010-07-29 01:31:25
@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
2010-07-29 09:04:49
It's a way to do publish/subscribe using MQ based messaging.
Albert T. Wong
2010-07-29 18:25:13
Can you give me an example of what the workflow would be from start to finish?
spinon
2010-07-29 18:56:04