IView Interface
The interface definition for a PureMVC MultiCore View.
In PureMVC, IView implementors assume these responsibilities:
- Maintain a cache of IMediator instances.
- Provide methods for registering, retrieving, and removing IMediators.
- Managing the IObserver lists for each INotification.
- Providing a method for attaching IObservers to an INotification's IObserver list.
- Providing a method for broadcasting an INotification to each of the IObservers in a list.
- Notifying the
IObservers
of a given INotification when it broadcast.
See IMediator, IObserver, INotification
Implemented by
Methods
Code void set multitonKey(String key) #
This IView's Multiton key
void set multitonKey( String key );
Code void notifyObservers(INotification note) #
Notify the IObservers for a particular INotification.
All previously attached IObservers for this INotification's list are notified and are passed a reference to the INotification in the order in which they were registered.
- Param
note - the INotification to notify
IObservers
of.
void notifyObservers( INotification note );
Code void registerMediator(IMediator mediator) #
Register an IMediator instance with the IView.
Registers the IMediator so that it can be retrieved by name, and interrogates the IMediator for its INotification interests.
If the IMediator returns a list of INotification
names to be notified about, an Observer is created encapsulating
the IMediator instance's handleNotification
method
and registering it as an IObserver for all INotifications the
IMediator is interested in.
- Param mediator - a reference to the IMediator instance.
void registerMediator( IMediator mediator );
Code void registerObserver(String noteName, IObserver observer) #
Register an IObserver to be notified of INotifications with a given name.
- Param noteName - the name of the INotification to notify this IObserver of.
- Param observer - the IObserver to register.
void registerObserver( String noteName, IObserver observer);
Code void removeObserver(String noteName, Object notifyContext) #
Remove an IObserver from the list for a given INotification name.
- Param noteName - which IObserver list to remove from.
- Param notifyContext - remove IObservers with this object as the notifyContext.
void removeObserver( String noteName, Object notifyContext );