Files
DesignPatternsPHP/Behavioral/Observer/README.md
Antonio Spinelli e59d70a0ac start a restructure
2014-03-21 18:03:45 -03:00

14 lines
460 B
Markdown

# Observer
## Purpose
To implement a publish/subscribe behaviour to an object, whenever a "Subject" object changes it's state, the attached
"Observers" will be notified. It is used to shorten the amount of coupled objects and uses loose coupling instead.
## Examples
* a message queue system is observed to show the progress of a job in a GUI
## Note
PHP already defines two interfaces that can help to implement this pattern: SplObserver and SplSubject.