July 2001
Beginner to intermediate
368 pages
6h 52m
English
In learning the Observer pattern, I looked at which object is best able to handle future variation. In the case of the Observer pattern, the object that is triggering the event—the Subject—cannot anticipate every object that might need to know about the event. To solve this, I create an Observer interface and require that all Observers be responsible for registering themselves with this Subject.
While I focused on the Observer pattern during the chapter, it is worth pointing out several object-oriented principles that are used in the Observer pattern.
| Concept | Discussion |
|---|---|
| Objects are responsible for themselves | There were different kinds of Observers but all gathered the information they needed from the Subject and took the action appropriate ... |