The Template Method
Defines the skeleton of a ritual in an operation, deferring specific somatic steps to subclasses.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Evocation // Formalization
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// TCL PATTERN //
oo::class create BaseRitual {
method drawCircle {} { puts "Drawing a standard salt circle." }
method speakChant {} { error "Not implemented" }
method sealPortal {} { puts "Sealing the portal." }
method executeRitual {} {
my drawCircle
my speakChant
my sealPortal
}
}
oo::class create BloodMagicRitual {
superclass BaseRitual
method speakChant {} { puts "Chanting in forbidden sanguine tongue..." }
}
set darkRitual [BloodMagicRitual new]
$darkRitual executeRitual
The Template Method
The fundamental framework of an invocation rarely changes—a circle is drawn, the spell is cast, and the portal is closed. The Template Method cements the unyielding bones of the ritual in the parent class while leaving specific, dangerous steps open to polymorphic override by adept apprentices.
Runic Tags:
#behavioral
#template method
#evocation
#inheritance