Namespace: PureMVC.Interfaces.IObserver
Interface IObserver
All Known Implementing Classes: - TObserver
public interface IObserver
Persistent- False
see
remarks- In PureMVC, IObserver implementors assume these responsibilities:Encapsulate the notification (callback) method of the interested objectEncapsulate the notification context (this) of the interested objectProvide methods for setting the interested object' notification method and contextProvide a method for notifying the interested objectPureMVC does not rely upon underlying event modelsThe Observer Pattern as implemented within PureMVC exists to support event driven communication between the application and the actors of the MVC triadAn 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 objectObservers can receive Notifications by having their notifyObserver method invoked, passing in an object implementing the INotification interface, such as a subclass of Notification
summary- The interface definition for a PureMVC Observer
NotifyContext
public NotifyContext: TObject
Type- TObject
Access- write
NotifyMethod
public NotifyMethod: string
Type- string
Access- write
CompareNotifyContext
public function CompareNotifyContext(Obj: TObject): Boolean
Reintroduce- False
Returns- Boolean
summary- Compare the given object to the notificaiton context object
returns- Indicates if the notification context and the object are the same.
param- The object to compare
NotifyObserver
public procedure NotifyObserver(Notification: PureMVC.Interfaces.INotification.INotification )
Reintroduce- False
summary- Notify the interested object
param- The INotification to pass to the interested object's notification method
SetNotifyContext
public procedure SetNotifyContext(Value: TObject)
Reintroduce- False
summary- The notification context (this) of the interested object
SetNotifyMethod
public procedure SetNotifyMethod(Value: string)
Reintroduce- False
summary- The notification (callback) method of the interested object
remarks- The notification method should take one parameter of type INotification