The State Pattern

dead-metaphor GovernanceObject-Oriented Design

Categories: software-engineering

What It Brings

A state, in governance, is a political entity with defined borders, internal laws, and recognized transitions of power. The GoF State pattern maps this onto software: an object delegates its behavior to a state object, and when the state changes, the object’s behavior changes with it. The metaphor — thin as it is — frames behavioral change as territorial: the object enters a new state the way a nation transitions between peace and war, each state carrying its own rules of engagement.

Key structural parallels:

Where It Breaks

Expressions

Origin Story

The word “state” entered computing from mathematics and physics, where it describes the current condition of a system. But the word itself derives from the Latin status (“standing, condition”), which also gave rise to “state” as in “nation-state” — an entity with defined condition, territory, and laws. The GoF State pattern (1994) formalized the idea of delegating behavior to state objects, but by 1994, “state” in computing was already so thoroughly naturalized that the political metaphor was nearly invisible. The pattern’s name is functional rather than evocative — it tells you what the pattern manages (state) rather than importing a vivid source domain. This makes it one of the thinnest metaphors in the GoF catalog, but also one of the most transparent: nobody is confused about what the State pattern does.

References

Related Mappings