The Template Method: The Skeleton Ritual
Defining the skeleton of an algorithm, deferring specific steps to subclasses or functions.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Conjuration // Ritual-Frameworks
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
module TemplateMethod
-- The Template
record RitualSkeleton where
constructor MkSkeleton
prepare : String
ignite : String
banish : String
performRitual : RitualSkeleton -> String
performRitual (MkSkeleton p i b) =
"Start. " ++ p ++ " -> " ++ i ++ " -> " ++ b ++ " .End"
-- Specific Implementations
demonSummoning : RitualSkeleton
demonSummoning = MkSkeleton "Draw Blood Sigil" "Burn Brimstone" "Bind Name"
angelInvoking : RitualSkeleton
angelInvoking = MkSkeleton "Chant Hymn" "Light Incense" "Offer Grace"
Every great invocation shares a cosmic cadence: preparation, ignition, and resolution. The Template Method formalizes this sequence into a RitualSkeleton. It locks the overarching structure of the algorithm in place (performRitual), whilst leaving the precise alchemical details to be injected later. The Theorem Proving Pacts enforce that no step in the sequence can ever be omitted by a negligent apprentice.
Runic Tags:
#behavioral
#records
#frameworks