The Chain of Responsibility Incantation in Simula
Passing a mystical request along a sequence of potential handlers.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Evocation // Delegation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SIMULA PATTERN //
Begin
Class Handler;
Virtual: Procedure HandleRequest;
Begin
Ref(Handler) successor;
End;
Handler Class ConcreteHandler;
Begin
Procedure HandleRequest;
Begin
If CanHandle Then
! Resolve the magic;
Else If successor =/= None Then
successor.HandleRequest;
End;
End;
End;
When a request is cast into the simulation, it is caught by the Chain. If the first node cannot process the incantation, it passes it along the ethereal links until an adept handler quells the invocation.
Runic Tags:
#simula
#gof
#behavioral
#delegation