Hi,
I would like to suggest another approach for the same issue discussed in the original post:
http://forums.puremvc.org/index.php?topic=596.0The original discussion suggests the mediator using the
type property of the notification as a discriminator, only taking action if it matches its own name.
This approach results in multiple mediators being called to handle the same notification, while only a single one is actually interested in it and taking an action.
I would suggest using the notification name for pairing mediators and proxies in the following way:
The same as in the original post, both mediator and proxy pair are given a unique key on registration.
The mediator adds this key to its list of notifications interests.
This key serves as the
name parameter of the notification leaving the Proxy.
This way, these notifications are handled only by the mediator who included this name in its list of notifications interests - the corresponding pair.
Any thoughts are welcome.
Cheers,
-Ilan