The Template Method of the Dark Ritual
Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Evocation // Ritual Casting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// FOXPRO PATTERN //
DEFINE CLASS DarkRitual AS Custom
PROCEDURE PerformRitual()
THIS.DrawPentagram()
THIS.ChantIncantation()
THIS.OfferSacrifice()
? "The ritual is complete."
ENDPROC
PROCEDURE DrawPentagram()
? "Drawing a standard pentagram in blood."
ENDPROC
PROCEDURE ChantIncantation()
* To be overridden
ENDPROC
PROCEDURE OfferSacrifice()
* To be overridden
ENDPROC
ENDDEFINE
DEFINE CLASS SummonFiendRitual AS DarkRitual
PROCEDURE ChantIncantation()
? "Chanting the true name of the Fiend of Indexes."
ENDPROC
PROCEDURE OfferSacrifice()
? "Offering a corrupted DBF header as sacrifice."
ENDPROC
ENDDEFINE
The framework of the ritual must be strictly preserved; if steps are executed out of order, the caster will be consumed. The Template Method fixes the immutable flow of operations while allowing acolytes to override only the safe, variable steps.
Runic Tags:
#behavioral
#template-method
#inheritance
#skeleton