Question

I trying to write my own Event Aggregation class and i go some articles but i want to go step by step with this pattern, for example i want to create it with 2 simple classes, such as User class and Email notification class, so that when user change his password an email sent to him.
I don't want to care for now with generics, i want it as simple as possible.

I didn't find any books or videos talking about this pattern at all, did you met one before?

Was it helpful?

Solution

Microsoft has an Event Aggregation QuickStart that is a reasonable code sample walkthrough. It deals with only a few classes, and uses a similar scenario to a User / Email relationship (Financial Transaction / Logging). The sample does use generics however, but this would be the same for all PRISM samples as this is the way Patterns & Practices implemented the event aggregator pattern.
.

OTHER TIPS

This doesn't sound like classic Event Aggregation, which has several Event Producers, you just have one producer. However if, perhaps as a learning exercise, you want to separate the Event distribution by using the aggregator pattern then it seems well covered in Fowler's description.

Article at CodeProject: Prism Event Aggregator Service And Extension Methods

I would also check out Prism by P&P

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top