Proxy: The Spectral Sentinel
Provide a surrogate or placeholder to control access to the true Rune.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Conjuration // Calling
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// RPG PATTERN //
**FREE
Ctl-Opt NoMain;
Dcl-S pRealRune Pointer Static Inz(*Null);
Dcl-Proc InvokeProxy Export;
Dcl-Pi *N;
End-Pi;
// Lazy Initialization of the expensive Rune
If pRealRune = *Null;
pRealRune = InitHeavyRune();
EndIf;
// Access Control or Logic
If HasPermission();
CallRealRune(pRealRune);
EndIf;
End-Proc;
Proxy
The Proxy pattern guards the threshold to computationally expensive legacy programs. Whether it delays the loading of massive DB2 indexes (Lazy Proxy) or enforces user authorization (Protection Proxy), it wears the face of the true spell but commands the gateway.
Runic Tags:
#structural
#ibm-i
#runes
#proxy