🗼 EIFFEL CONTRACT DIFFICULTY: Adept Behavioral

The Template Method Ritual

Defining the skeleton of a spell, deferring steps to subclasses.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Conjuration // Ritualism
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
deferred class
    BASE_RITUAL

feature -- Template Method
    perform_ritual
        do
            draw_circle
            chant_words
            ignite
        end

feature {NONE} -- Steps
    draw_circle
        deferred
        end

    chant_words
        deferred
        end

    ignite
        do
            -- Default spark
        end
end

The Template Method secures the unchangeable skeleton of a ritual, while allowing apprentice mages to substitute specific incantations safely.

Runic Tags: #behavioral #template-method #eiffel