The Proxy of the Guardian Gargoyle
Provide a surrogate or placeholder for another object to control access to it.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Abjuration // Warding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// FOXPRO PATTERN //
DEFINE CLASS ForbiddenTome AS Custom
PROCEDURE ReadSecrets()
? "Reading the unspeakable truths of FoxPro array dimensioning."
ENDPROC
ENDDEFINE
DEFINE CLASS TomeProxy AS Custom
oRealTome = .NULL.
nClearanceLevel = 0
PROCEDURE Init(nLevel)
THIS.nClearanceLevel = nLevel
ENDPROC
PROCEDURE ReadSecrets()
IF THIS.nClearanceLevel < 99
? "The Gargoyle awakens and repels you! Access Denied."
ELSE
IF ISNULL(THIS.oRealTome)
THIS.oRealTome = CREATEOBJECT("ForbiddenTome")
ENDIF
THIS.oRealTome.ReadSecrets()
ENDIF
ENDPROC
ENDDEFINE
The Proxy stands as a stone guardian before the true power. It may delay the expensive summoning of the entity until truly necessary, or it may entirely forbid access to those lacking the arcane clearance.
Runic Tags:
#structural
#proxy
#access-control
#lazy-loading