The State Incantation in Simula
Altering an object's core behavior when its internal humours shift.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Metamorphosis
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SIMULA PATTERN //
Begin
Class State;
Virtual: Procedure Handle(context); Ref(Context) context;
Begin
End;
Class Context;
Begin
Ref(State) currentState;
Procedure Request;
Begin
currentState.Handle(This Context);
End;
End;
End;
An entity’s behavior is often shackled to its internal state. As the humours shift—from calm to fury, from water to steam—the State pattern swaps the soul of the object, altering its reactions seamlessly.
Runic Tags:
#simula
#gof
#behavioral
#metamorphosis