MessageBus without PubSubEvent

Topics: Prism v4 - WPF 4
May 11, 2014 at 5:30 PM
Are there any performance issues with using this approach for Pub/Sub events?

The idea is to wrap a message in a generic PubSubEvent so you can write the message like this:
// Create the Event Message
public class TickerSymbolSelectedMessage
{
    public string StockSymbol { get; set; }
}
And the you can send it like this:
// Broadcast Events
EventSystem.Publish<TickerSymbolSelectedMessage>(
    new TickerSymbolSelectedMessage{ StockSymbol = “STOCK0”});
I like this and it remind me of the messagebus in RxUI
May 12, 2014 at 3:16 PM
Hi Martin,

The Blogpost you referenced describes an approach based on a simple wrapping for the GetEvent method in particular in order to not be redundantly called each time.
Based on my understanding, the approach you mentioned would be a good optimization in regards to code cleaning and simplicity.
I would not think right now on any performance issues that this wrapping would cause. However, as the blogpost points out, I can't tell how a big application would behave with many calls to EventSystem class.

I hope this helped you,
Regards.

Gabriel Ostrowsky.
https://blogs.southworks.net/gostrowsky