.

Context:

See Observer.

Challenge:

See Observer.

Skill:

Participants:

Observer:

An object that reflects the state of some Resource, (e.g. view over documents). Responsible for registering itself for modification by that Resource.

Subject:

A resource whose state is reflected by other objects. Responsible for notifying its observers when it has suffered change.

Concrete Observer:

An object that implements Observer skills. Knows how to respond to change notification.

Concrete Subject:

An object that implements Subject skills. Knows when to notifie Observers of its own change.

Signature:

Subject references Observers. Often, Concrete Observer contains or references Concrete Subjects (e.g. view and document).

Used patterns and idioms:

(Variation on) Rectangular Inheritance of Association.

Source:

GOF.

Scope:

General.