The Template Method
Etching the skeleton of an incantation into a base Gallina Ward, letting derivative runes fill in the dangerous details.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Conjuration // Schematics
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
(* Gallina Ward: Template Method *)
Require Import String.
(* The Template defines the skeleton *)
Record RitualTemplate := {
prepareMaterials : string;
chantWords : string;
sealWard : string
}.
Definition performRitual (rt : RitualTemplate) : string :=
rt.(prepareMaterials) ++ " -> " ++ rt.(chantWords) ++ " -> " ++ rt.(sealWard).
(* Concrete subclasses provide the missing steps *)
Definition FireRitual : RitualTemplate := {|
prepareMaterials := "Gather Sulfur";
chantWords := "Ignis Wrath";
sealWard := "Seal of Ash"
|}.
Definition VoidRitual : RitualTemplate := {|
prepareMaterials := "Gather Dark Matter";
chantWords := "Nihil Est";
sealWard := "Seal of Emptiness"
|}.
Runic Tags:
#template-method
#gallina
#wards