PureMVC Framework for haXe: API Documentation
Back | Index
interface org.puremvc.haxe.interfaces.IMediator

The interface definition for a PureMVC Mediator.

In PureMVC, IMediator implementors assume these responsibilities:

Additionally, IMediators typically:

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.

function getMediatorName() : String
Get the IMediator instance name
function getViewComponent<T>() : T
Get the IMediator's view component.
function handleNotification(notification : INotification) : Void
Handle an INotification.
function listNotificationInterests() : Array<String>
List INotification interests.
function onRegister() : Void
Called by the View when the Mediator is registered
function onRemove() : Void
Called by the View when the Mediator is removed
function setViewComponent<T>(viewComponent : T) : Void
Set the IMediator's view component.
Back | Index