⚙️ ISABELLE RUNE DIFFICULTY: Adept Behavioral

The Template Method

Define the skeleton of an algorithm in an operation, deferring some steps to subclasses or providing function parameters.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Divination // Blueprinting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// ISABELLE PATTERN //
theory TemplateMethod
  imports Main
begin

record ritual_template =
  prepare_components :: "unit \<Rightarrow> string"
  chant_incantation :: "unit \<Rightarrow> string"

definition perform_ritual :: "ritual_template \<Rightarrow> string" where
  "perform_ritual template = prepare_components template @ '' and '' @ chant_incantation template"

end
Runic Tags: #isabelle #hol #divination #design-patterns