Class IObserver
source code
object --+
|
IObserver
- Known Subclasses:
-
The interface definition for a PureMVC Observer.
In PureMVC, IObserver
implementors assume these
responsibilities:
Encapsulate the notification (callback) method of the interested
object.
Encapsulate the notification context of the interested object.
Provide methods for setting the interested object' notification method
and context.
Provide a method for notifying the interested object.
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
.
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__init__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
Set the notification method.
The notification method should take one parameter of type
INotification
Raises NotImplemented if subclass does not implement this
method.
- Parameters:
notifyMethod - the notification (callback) method of the interested object
|
Set the notification context.
Raises NotImplemented if subclass does not implement this
method.
- Parameters:
notifyContext - the notification context (this) of the interested object
|
Notify the interested object.
Raises NotImplemented if subclass does not implement this
method.
- Parameters:
notification - the INotification to pass to the interested object's
notification method
|
Compare the given object to the notification context object.
Raises NotImplemented if subclass does not implement this
method.
- Parameters:
obj - the object to compare.
- Returns:
- boolean indicating if the notification context and the object are
the same.
|