Mediator class

A base IMediator implementation.

In PureMVC, IMediator implementors assume these responsibilities:

  • Implement a common method which returns a list of all INotifications the IMediator has interest in.
  • Implement a notification (callback) method for handling INotifications.
  • Implement methods that are called when the IMediator is registered or removed from an IView.

Additionally, IMediators typically:

  • Act as an intermediary between one or more view components and the rest of the application.
  • Place Event listeners on view components, and implement handlers which often send INotifications or interact with IProxys to post or retrieve data.
  • Receive INotifications, (typically containing data) and updating view components in response.

When an IMediator is registered with the IView, the IMediator's listNotificationInterests method is called The IMediator will return a List of INotification names which it wishes to be notified about.

The IView will then create an IObserver object encapsulating that IMediator's and its handleNotification method and register the IObserver for each INotification name returned by the IMediator's listNotificationInterests method.

See INotification, IView

Inheritance
Implemented types

Constructors

Mediator(String name, [dynamic viewComponent])
Constructor [...]

Properties

facade IFacade
Return the Multiton Facade instance [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
name String
This IMediator's name.
read / write, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
viewComponent ↔ dynamic
This IMediator's viewComponent.
read / write, override

Methods

getMultitonKey() String
inherited
getName() String
Get the IMediator instance's name. [...]
override
getViewComponent() → dynamic
Get the IMediator's viewComponent. [...]
override
handleNotification(INotification note) → void
Handle an INotification. [...]
override
initializeNotifier(String key) → void
Initialize this INotifier instance. [...]
inherited
listNotificationInterests() List<String>
List INotification interests. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onRegister() → void
Called by the IView when the IMediator is registered.
override
onRemove() → void
Called by the IView when the IMediator is removed.
override
sendNotification(String noteName, [dynamic body, String type]) → void
Send an INotification. [...]
inherited
setViewComponent(dynamic component) → void
Set the IMediator's viewComponent. [...]
override
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited