Posted by FluffyCat on 05/09/06 02:10
Last week I continued my series of design patterns examples using PHP
5. Here now is my 14th example, the Observer pattern.
http://www.fluffycat.com/PHP-Design-Patterns-Observer/
In the Observer Pattern, a Subject object notifies an Observer object
if it's the Subject object's state changes.
Pretty simple and fairly useful.
An application for this pattern might be having a Subject object with
the state of a web page, and an Observer object which can produce RSS
feeds. If the Subject page changes it notifies the Observer object,
which produces an RSS feed for the changed page.
[Back to original message]
|