====== JObservable [Review] ====== {#JAPI Joomla.Framework Base JObservable #} This is an abstract observable class to implement the [[http://en.wikipedia.org/wiki/Observer_design_pattern|Observer design pattern]]. It is extended by [[references:joomla.framework:application:jeventdispatcher|JEventDispatcher]] which is instantiated by [[references:joomla.framework:application:japplication|JApplication]]. JObservable is a subclass of [[references:joomla.framework:object|JObject]]. The Observer design pattern provides the possibility of having observable objects raising events triggered through the [[references:joomla.framework:application:jeventdispatcher|Event Dispatcher]]. [[JObserver||Observers]] can be attached to an instance of an Observable so that they can be notified when specific events occur during the life-cycle of this particular object. ===== Methods ===== ^ Method ^ Description ^ | {{references:Constructor.png?nolink}} [[JObservable-__construct|__construct]] | Class constructor. | | {{references:Method.png?nolink}} [[JObservable-attach|attach]] | Attach an Observer object. | | {{references:Method.png?nolink}} [[JObservable-detach|detach]] | Detach an Observer object. | | {{references:Method.png?nolink}} [[JObservable-getState|getState]] | Get the state of the Observable object. | | {{references:Method.png?nolink}} [[JObservable-notify|notify]] | [[JObserver-update.txt|Update]] each attached Observer and return an array of their return values. | ---- ~~DISCUSSION~~