previous up next Observer

Intent, Motivation, Applicability, Structure, Participants, Collaborations, Consequences, Implementation, Sample Code, Known Uses, Related Patterns

previous next Implementation

Several issues related to the implementation of the dependency mechanism are discussed in this section.

  1. Mapping subjects to their observers.

  2. Observing more than one subject.

  3. Who triggers the update?

  4. Dangling references to deleted subjects.

  5. Making sure Subject state is self-consistent before notification.

  6. Avoiding observer-specific update protocols: the push and pull models.

  7. Specifying modifications of interest explicitly.
  8. Encapsulating complex update semantics.
  9. Combining the Subject and Observer classes.


Implementation of Abstract Factory, Adapter, Bridge, Builder, Chain of Responsibility, Command, Composite, Decorator, Facade, Factory Method, Flyweight, Interpreter, Iterator, Mediator, Memento, Observer, Prototype, Proxy, Singleton, State, Strategy, Template Method, Visitor

previous next