puremvc
|
|
« Reply #1 on: November 13, 2011, 04:17:49 » |
|
With events, a class that want's to listen for an event must have a reference to the object it wants to add the event listener.
Not so with notifications (or notes for short). When a mediator is registered, it is interrogated (has its listNotifications method called) by the framework. It need only return a list of the notes it is interested in receiving. This is more like a publish/subscribe system. Also a command can be registered to a given note name, and it will be instantiated and executed and passed the notification. Again, it had no reference to the sender, in fact it doesn't even exist until after the note is sent.
|