April 2004
Intermediate to advanced
520 pages
10h 10m
English
This pattern was previously described in GoF95.
The Observer pattern is useful for designing a consistent communication model between a set of dependent objects and an object that they are dependent on. This allows the dependent objects to have their state synchronized with the object that they are dependent on. The set of dependent objects are referred to as observers and the object that they are dependent on is referred to as the subject. In order to accomplish this, the Observer pattern suggests a publisher-subscriber model leading to a clear boundary between the set of Observer objects and the Subject object.
A typical observer is an object with interest or dependency in the state of the subject. A subject can ...