Solly
Lesson

Vocabulary: Observer

Vocabulary after construction: Observer

The previous exercise began with Expected Behavior and design pressure, not with this name.

The structure that emerged is traditionally called Observer.

What the reasoning established

  • Stable role: Listeners are callables reacting to a published fact.
  • Change pressure: Independent reactions can be added without modifying the publisher.
  • Ownership/lifetime when relevant: Subscribe/unsubscribe explicitly controls listener membership.
  • Structural consequence: The publisher owns subscriptions, not concrete listener knowledge.
  • Runtime topology: publish iterates a snapshot in registration order.

Nearby distinction

Mediator: Observer decouples independent reactions to a fact; Mediator coordinates participants required to complete a workflow.

Simplify

Ask whether any abstraction can be removed while preserving the original acceptance behavior and design-stress property. If yes, prefer the simpler design.

Use the pattern name to communicate a structure you can already justify. Do not use the name as a recipe that replaces requirements analysis.

Sign in with an enabled provider to save your lesson progress.
Sign in to track progress

Loading sign-in options…