The Template Method
Defining the skeleton of a ritual, leaving details to acolytes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Evocation // Subschool: Rituals
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// OBJC PATTERN //
@interface TKRitual : NSObject
- (void)performRitual;
- (void)prepareAltar;
- (void)chant;
- (void)ignite;
@end
@implementation TKRitual
- (void)performRitual {
[self prepareAltar];
[self chant];
[self ignite];
}
- (void)prepareAltar { /* Base preparation */ }
- (void)chant { @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Must override chant" userInfo:nil]; }
- (void)ignite { /* Base ignition */ }
@end
The Template Method establishes the immutable sequence of a grand ritual. Subclasses must fill in the perilous abstract voids to complete the spell.
Runic Tags:
#objc
#template-method
#behavioral