Skip to main content

Memento

The Memento design pattern without violating encapsulation, captures and externalizes an object‘s internal state so that the object can be restored to this state later.

Usage     Usage     Low

UML class diagram

A visualization of the classes and objects participating in this pattern.

diagram

Sample code

This structural code demonstrates the Memento pattern which temporary saves and restores another object's internal state.

Output

See also