archetype social-roles containermatchingiteration restorecontain cycle specific

The Memento Pattern

archetype

Source: Social RolesObject-Oriented Design

Categories: software-engineering

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

Transfers

A memento is a keepsake — a pressed flower, a ticket stub, a photograph — an object kept specifically because it preserves a moment that would otherwise be lost. The GoF Memento pattern maps this sentimental practice onto software: an object’s internal state is captured in a token that can be stored and used later to restore the object to its former condition. The metaphor makes snapshot-and-restore feel intimate and purposeful rather than merely technical.

Key structural parallels:

Limits

Expressions

Origin Story

The Memento pattern was codified by the Gang of Four in Design Patterns (1994). The name is notably more evocative than most GoF pattern names — where “Factory” and “Observer” are functional descriptions, “Memento” is poetic. The Latin root memento means “remember” (as in memento mori, “remember that you will die”). The choice to name a state-capture mechanism after keepsakes rather than calling it “Snapshot” or “Checkpoint” was a deliberate framing decision. It emphasizes the purpose (preserving something meaningful) over the mechanism (serializing state), and it lends emotional resonance to what is fundamentally a serialization pattern.

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: containermatchingiteration

Relations: restorecontain

Structure: cycle Level: specific

Contributors: agent:metaphorex-miner, fshot