October 2006
Intermediate to advanced
288 pages
5h 55m
English
The Observer pattern is a design pattern that is used to observe the state of an object in an application. The observed object allows other objects to register and unregister as observers. The observers are notified when specific events that they are observing are fired. The observed object has three distinct methods, which are outlined next.
The Observer pattern essentially allows an unlimited number of objects to observe or listen to events in the observed object (or subject) by registering themselves. After observers are registered to an event, the subject will notify them when the event is fired. The subject handles this by storing an observer collection and iterating through it when the event ...
Read now
Unlock full access