EventAggregator for Messaging

Topics: Prism v2 - WPF 3.5
Feb 5, 2010 at 3:35 AM

I'm using PRISM for developing a financial application. Our requirement is to be able to communicate across modules/process/machine boundaries.

For our first delivery we only want to be able to communicate between modules. However, we want to build a design which can be extended to cross-process/machine at a later stage without much change to existing stuff.

Solution im considering

I'm considering using EventAggregator for the first delivery. I plan to extend it at a later stage by building a listener module that can listen to the events and wire them to a bus for cross process communication. I'm concerned about two things here :

  • Is it as elegant as i think it is. In terms of simplicity and providing the flexibility to extend it later using any sort of listener and wiring we want.
  • When the volume of communication increases, would it hit the performance significantly.

 

Need suggestions, inputs please.

Thanks.

 

Feb 5, 2010 at 1:47 PM

Hi,

The solution you are proposing seems like a good one, as it provides extensibility  and the possibility to change the behavior by simply adding a module to the application.

As the EventAggregator is meant for inter-module communication, another possible solution could be creating a “Communication Service” that is in charge of your application’s communication.

At first, this would only wrap the EventAggregator’s functionality, but eventually you can change the underlying implementation of the service to use an Enterprise Service Bus or any other form of communication. Since the interface of the service should not change, you don’t need to make any modifications to the application.

Take into account that the underlying implementation of the service should be able to discern between an event that should be made available publicly and one that is only mean for use as EA default functionality to avoid over consuming the Service Bus.

You should take the approach you find most suiting for your application/familiy of applications.

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman