Package | org.puremvc.as3.interfaces |
Interface | public interface IObserver |
Implementors | Observer |
In PureMVC, IObserver
implementors assume these responsibilities:
PureMVC does not rely upon underlying event models such as the one provided with Flash, and ActionScript 3 does not have an inherent event model.
The Observer Pattern as implemented within PureMVC exists to support event driven communication between the application and the actors of the MVC triad.
An Observer is an object that encapsulates information about an interested object with a notification method that should be called when an INotification is broadcast. The Observer then acts as a proxy for notifying the interested object.
Observers can receive Notification
s by having their
notifyObserver
method invoked, passing
in an object implementing the INotification
interface, such
as a subclass of Notification
.
See also
Method | Defined by | ||
---|---|---|---|
compareNotifyContext(object:Object):Boolean
Compare the given object to the notificaiton context object.
| IObserver | ||
notifyObserver(notification:INotification):void
Notify the interested object.
| IObserver | ||
setNotifyContext(notifyContext:Object):void
Set the notification context.
| IObserver | ||
setNotifyMethod(notifyMethod:Function):void
Set the notification method.
| IObserver |
compareNotifyContext | () | method |
public function compareNotifyContext(object:Object):Boolean
Compare the given object to the notificaiton context object.
Parametersobject:Object — the object to compare.
|
Boolean — boolean indicating if the notification context and the object are the same.
|
notifyObserver | () | method |
public function notifyObserver(notification:INotification):void
Notify the interested object.
Parametersnotification:INotification — the INotification to pass to the interested object's notification method
|
setNotifyContext | () | method |
public function setNotifyContext(notifyContext:Object):void
Set the notification context.
ParametersnotifyContext:Object — the notification context (this) of the interested object
|
setNotifyMethod | () | method |
public function setNotifyMethod(notifyMethod:Function):void
Set the notification method.
The notification method should take one parameter of type INotification
notifyMethod:Function — the notification (callback) method of the interested object
|