The Template of Rituals
Defining the skeleton of an algorithm in an interface, deferring steps to subclasses.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Evocation // Rituals
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# The Template defined by the Interface
interface Ritual {
id: ID!
# Common step 1
gatherIngredients: [String!]!
# Common step 2
chantIncantation: String!
# The specific result (deferred to implementation)
ritualEffect: String!
}
type SummoningRitual implements Ritual {
id: ID!
gatherIngredients: [String!]!
chantIncantation: String!
# Specific implementation
ritualEffect: String! # E.g., "A demon appears"
demonName: String!
}
type BanishingRitual implements Ritual {
id: ID!
gatherIngredients: [String!]!
chantIncantation: String!
# Specific implementation
ritualEffect: String! # E.g., "The demon is banished"
targetDimension: String!
}
The Template Method in schema design uses Interfaces to enforce a strict skeleton of fields (the algorithm’s steps or common attributes) that every concrete type must implement. The specific, varying behaviors or extra fields are then deferred to the implementing types.
Runic Tags:
#graphql
#behavioral
#template-method
#interfaces