💠 F# SIGILS DIFFICULTY: Apprentice Behavioral

The Template Method Ritual

Defining the skeleton of a ritual in an operation, deferring specific chanting to subclasses.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Conjuration // Rituals
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// FSHARP PATTERN //
[<AbstractClass>]
type BaseRitual() =
    abstract member PrepareComponents: unit -> unit
    abstract member Chant: unit -> unit
    abstract member Ignite: unit -> unit

    // The Template Method
    member this.PerformRitual() =
        this.PrepareComponents()
        this.Chant()
        this.Ignite()
        printfn "The ritual concludes in a burst of magic."

type FireDemonRitual() =
    inherit BaseRitual()
    override _.PrepareComponents() = printfn "Gathering sulfur and ash."
    override _.Chant() = printfn "Chanting in ignan: 'Ignis ire!'"
    override _.Ignite() = printfn "Lighting the brimstone circle."

let summoning = FireDemonRitual()
summoning.PerformRitual()

The Template Method acts as a master grimoire’s index. It prescribes the inescapable order of the ritual (Prepare, Chant, Ignite), while the specialized cults fill in the specific words of power.

Runic Tags: #behavioral #template-method #fsharp #rituals