|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IObserver
The interface definition for a PureMVC 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
.
IView
,
INotification
Method Summary | |
---|---|
boolean |
compareNotifyContext(java.lang.Object object)
Compare the given object to the notificaiton context object. |
void |
notifyObserver(INotification notification)
Notify the interested object. |
void |
setNotifyContext(java.lang.Object notifyContext)
Set the notification context. |
void |
setNotifyMethod(IFunction notifyMethod)
Set the notification method. |
Method Detail |
---|
void setNotifyMethod(IFunction notifyMethod)
The notification method should take one parameter of type
INotification
notifyMethod
- the notification (callback) method of the interested objectvoid setNotifyContext(java.lang.Object notifyContext)
notifyContext
- the notification context (this) of the interested objectvoid notifyObserver(INotification notification)
notification
- the INotification
to pass to the interested
object's notification methodboolean compareNotifyContext(java.lang.Object object)
object
- the object to compare.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |