org.puremvc.php.interfaces
[ class tree: org.puremvc.php.interfaces ] [ index: org.puremvc.php.interfaces ] [ all elements ]

Class: IObserver

Source Location: /interfaces/IObserver.php

Interface Overview


The interface definition for a PureMVC Observer.


Author(s):

Methods



Class Details

[line 53]
The interface definition for a PureMVC Observer.

In PureMVC,

implementors assume these responsibilities:
  • Encapsulate the notification (callback) method of the interested object.
  • Encapsulate the notification context (this) 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 </code>INotification</code> is broadcast. The Observer then acts as a proxy for notifying the interested object.

Observers can receive

s by having their
method invoked, passing in an object implementing the
interface, such as a subclass of
.




Tags:

see:  org.puremvc.php.interfaces.INotification INotification
see:  org.puremvc.php.interfaces.IView IView


[ Top ]


Class Methods


method compareNotifyContext [line 85]

boolean compareNotifyContext( object the $object)

Compare the given object to the notificaiton context object.



Tags:

return:  indicating if the notification context and the object are the same.
access:  public


Parameters:

object the   $object   object to compare.

[ Top ]

method notifyObserver [line 77]

void notifyObserver( INotification $notification)

Notify the interested object.



Tags:

access:  public


Parameters:

notification   $notification   the
to pass to the interested object's notification method

[ Top ]

method setNotifyContext [line 70]

void setNotifyContext( notifyContext $notifyContext)

Set the notification context.



Tags:

access:  public


Parameters:

notifyContext   $notifyContext   the notification context (this) of the interested object

[ Top ]

method setNotifyMethod [line 63]

void setNotifyMethod( notifyMethod $notifyMethod)

Set the notification method.

The notification method should take one parameter of type




Tags:

access:  public


Parameters:

notifyMethod   $notifyMethod   the notification (callback) method of the interested object

[ Top ]


Documentation generated on Tue, 30 Sep 2008 08:05:45 -0700 by phpDocumentor 1.4.0