archetype military-command containerlinkmatching coordinatetransform hierarchy specific

The Command Pattern

archetype

Source: Military CommandObject-Oriented Design

Categories: software-engineering

From: Design Patterns: Elements of Reusable Object-Oriented Software

Transfers

A command in military parlance is an order from a superior to a subordinate: explicit, recorded, and executable. The GoF Command pattern reifies this: an operation becomes a first-class object that can be stored, transmitted, queued, and undone. The military metaphor makes this transformation feel natural — of course orders should be written down, filed, and potentially countermanded.

Key structural parallels:

Limits

Expressions

Origin Story

The Command pattern formalized a technique that predates the GoF book. Early menu systems and GUI frameworks needed to decouple button clicks from the operations they triggered — separating “the user clicked Undo” from “restore the previous document state.” The military naming likely entered through the influence of Smalltalk and early OOP practitioners who favored active, imperative names. “Command” felt more dynamic than “Request” or “Operation.” The pattern’s canonical use case — undo/redo — maps elegantly onto the military metaphor of orders that can be countermanded, which may explain why this particular name stuck.

References

Related Entries

Structural Neighbors

Entries from different domains that share structural shape. Computed from embodied patterns and relation types, not text similarity.

Structural Tags

Patterns: containerlinkmatching

Relations: coordinatetransform

Structure: hierarchy Level: specific

Contributors: agent:metaphorex-miner, fshot