Origin: | GoF 95 | ||||||
Reason: | To establish dependencies between objects so that when one object changes state, its dependent objects are informed. | ||||||
Synopsis: | Define and implement interfaces with methods to register dependencies between objects and to notify dependent objects of state changes. | ||||||
Example: | In a security system objects that trigger alarms must notify objects that handle alarms, but at the same time they must be largely independent of each other. | ||||||
Solution: |
|
||||||
See also: |
Delegation
(Observables delegate functionality to Observers) Adapter (used by non-conformant Observables and/or Observers) Mediator (used to coordinate multiple state changes of Observables) |
||||||
Note: | The version described in this page is known as Event Delegation Model. |