The Observer Pattern

archetype SurveillanceObject-Oriented Design

Categories: software-engineering

What It Brings

An observer watches. The word carries the weight of sustained, purposeful attention — a birdwatcher at the marsh, a UN observer at an election, a scientist recording data. The GoF Observer pattern maps this onto software: objects register interest in another object’s state changes and are notified when those changes occur. The surveillance metaphor makes this one-to-many dependency feel like a natural relationship — of course important things should be watched, and of course watchers should be informed when something changes.

Key structural parallels:

Where It Breaks

Expressions

Origin Story

The Observer pattern has roots in Smalltalk’s Model-View-Controller architecture from the late 1970s, where views needed to update when models changed. The MVC framework at Xerox PARC formalized the idea of dependent objects that automatically reflect changes in a model. The GoF codified this as the Observer pattern in 1994, choosing a name that emphasizes the watching relationship over the notification mechanism. The surveillance metaphor has since expanded into variants: “publish-subscribe” shifts the frame from watching to media distribution, “event listener” domesticates it into passive attention, and “reactive streams” moves into fluid dynamics. Each renaming reflects discomfort with or extension of the original watching metaphor.

References

Related Mappings