Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M0322

Memento Pattern

Memento Pattern
DecideHigh supportDecision Science
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

The memento pattern is a software design pattern in the field of object-oriented programming that allows reverting the state of an object. Uses of this design pattern include undo, version control, and serialization. The memento pattern is implemented with three objects: the originator, a caretaker …

Definition

Without violating encapsulation, capture an object's internal state and save it outside the object so that it can be restored later. That is, 'save/load'. Scaffold use: decision snapshot. Before making a major decision, write down your current feelings, the data you rely on, and the expected outcome (save). Review it half a year later (load), which is the best tool for calibrating intuition and avoiding hindsight bias.

How to use

Decision snapshot. Before making a major decision, write down your current feelings, the data you rely on, and the expected outcome (save). Review it half a year later (load), which is the best tool for calibrating intuition and avoiding hindsight bias.

Mechanism

Without violating encapsulation, capture and externally save the object's state, supporting lossless restoration later; decouple the 'state snapshot' from the object.

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Editor undo; game save; before a decision, write down feelings and basis, review half a year later to calibrate intuition.

Common pitfalls

  • Storing state inside the object breaks encapsulation; saving but never loading; abusing snapshots causing memory bloat.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Memento_patternZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS