Jason MacDonald
|
|
« Reply #1 on: November 06, 2008, 12:13:56 » |
|
The best practice is to have your Mediators handle any notifications (sending and receiving) on behalf of your view components. The Mediator listens for events fired by your view components and then transforms those into notifications when required.
As for GC issues, your Mediators should be in charge of tearing down your view component when they are no longer needed. When you tear down a Mediator, it then tears down the view components it's managing and removes any listeners (and perhaps sends notifications that the component has been removed).
A good practice is to override the onRemove() method of your Mediators so they can handle the cleanup of your view components. This way all you need to do is call facade.removeMediator() to completely remove a mediator, its view component and any references.
|