Observer Pattern

Overview

Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically

Participants

Abstract Subject

Abstract Observer

Concrete Subject

Observer implementation

Parameters

Attach Observer method

Detach Observer method

Notify Observer method

Observer update method

Applicability

Use the Observer pattern in any of the following situations: