The Abstract Factory of the Adobe Alchemy
Forge cohesive families of arcane constructs without binding to their concrete tag-wards.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Abstract Factory
ARCANUM SCHOOL: Conjuration // Wardcraft
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// COLDFUSION PATTERN //
interface name="IApparitionFactory" {
public ISpirit createSpirit();
public IWard createWard();
}
component name="FireApparitionFactory" implements="IApparitionFactory" {
public ISpirit function createSpirit() {
return new FireSpirit();
}
public IWard function createWard() {
return new FireWard();
}
}
component name="IceApparitionFactory" implements="IApparitionFactory" {
public ISpirit function createSpirit() {
return new IceSpirit();
}
public IWard function createWard() {
return new IceWard();
}
}
// Client code
factory = new FireApparitionFactory();
spirit = factory.createSpirit();
ward = factory.createWard();
The Abstract Factory weaves ancient CFML tag-wards to instantiate entire families of related spirits and defenses. It isolates the creation of apparitions so that an alchemist might swap a fiery conjuration for an icy one simply by changing the master sigil.
Runic Tags:
#abstract-factory
#coldfusion
#alchemy
#creation