/* PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. Your reuse is governed by the Creative Commons Attribution 3.0 United States License */ package org.puremvc.as3.interfaces { /** * The interface definition for a PureMVC Mediator. * *
* In PureMVC, IMediator
implementors assume these responsibilities:
INotification
s
* the IMediator
has interest in.
* Additionally, IMediator
s typically:
*
INotifications
, interacting with of
* the rest of the PureMVC app.
*
* When an IMediator
is registered with the IView
,
* the IView
will call the IMediator
's
* listNotificationInterests
method. The IMediator
will
* return an Array
of INotification
names which
* it wishes to be notified about.
* The IView
will then create an Observer
object
* encapsulating that IMediator
's (handleNotification
) method
* and register it as an Observer for each INotification
name returned by
* listNotificationInterests
.
* A concrete IMediator implementor usually looks something like this:
* *IMediator
instance name
*
* @return the IMediator
instance name
*/
function getMediatorName():String;
/**
* Get the IMediator
's view component.
*
* @return Object the view component
*/
function getViewComponent():Object;
/**
* Set the IMediator
's view component.
*
* @param Object the view component
*/
function setViewComponent( viewComponent:Object ):void;
/**
* List INotification
interests.
*
* @return an Array
of the INotification
names this IMediator
has an interest in.
*/
function listNotificationInterests( ):Array;
/**
* Handle an INotification
.
*
* @param notification the INotification
to be handled
*/
function handleNotification( notification:INotification ):void;
/**
* Called by the View when the Mediator is registered
*/
function onRegister( ):void;
/**
* Called by the View when the Mediator is removed
*/
function onRemove( ):void;
}
}