The Decorator Incantation in Simula
Dynamically weaving new powers onto a simulated object.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Enchantment // Enhancement
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SIMULA PATTERN //
Begin
Class Component;
Virtual: Procedure Operation;
Begin
End;
Component Class Decorator(comp); Ref(Component) comp;
Begin
Procedure Operation;
Begin
comp.Operation;
! Add mystical enhancements here;
End;
End;
End;
Rather than endlessly subclassing into madness, the Decorator envelops a solitary object in layers of newfound abilities, augmenting its behavior at runtime without altering its primordial core.
Runic Tags:
#simula
#gof
#structural
#enhancement