"Is that where the UserListLogger resides then"
Yes it chaind down. This example is not that helpful as it does not show any benefit of using the observer pattern. More details here
http://en.wikipedia.org/wiki/Observer_pattern
"Typical usages
The typical usages of the observer pattern:
Listening for an external event (such as a user action). See Event-driven programming.
Listening for changes of the value of an object property.
In a mailing list, where every time an event happens (a new product, a gathering, etc.) a message is sent to the people subscribed to the list.
The observer pattern is also very often associated with the model-view-controller (MVC) paradigm. In MVC, the observer pattern is used to create a loose coupling between the model and the view. Typically, a modification in the model triggers the notification of model observers which are actually the views."
PHP is usually a short running linear process and event changes are normally signalled by a page request which starts with a black slate except for the request variables.
When a whole new class is over kill for the task at hand creating the object is sometimes done in the following fashion in languages that allow it(PHP doesn't).
$ul->addObserver( new IObserver(){
function onChanged( $sender, $args )
{
// this has complete access to the current scope where $ul is.
echo( "'$args' added to user list\n" )
}
} );
PHP5 is in a funny land as it is getting settled, sometimes this pattern stuff gets bandied about with little discussion of anti patterns and also no clear path of usage. We just know we are supposed to use patterns and sometimes blindly join the cargo cult. The why is always more important than the how.