The Memento Incantation in Simula
Capturing and restoring the soul-state of an object without exposing its innards.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Necromancy // Preservation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SIMULA PATTERN //
Begin
Class Memento(state); Text state;
Begin
Text savedState;
savedState :- state;
End;
Class Originator;
Begin
Text state;
Ref(Memento) Procedure SaveToMemento; SaveToMemento :- New Memento(state);
Procedure RestoreFromMemento(m); Ref(Memento) m; state :- m.savedState;
End;
End;
Time is fickle, and mistakes in the simulation are fatal. The Memento extracts a snapshot of an object’s essence, storing it away so that if darkness falls, the entity may be restored to its former glory.
Runic Tags:
#simula
#gof
#behavioral
#preservation