The Chain of Responsibility of the Tribunal
Pass an arcane request along a chain of server-side adjudicators.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Abjuration // Wards
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// COLDFUSION PATTERN //
component name="Ward" {
variables.nextWard = null;
public Ward function setNext(Ward next) {
variables.nextWard = arguments.next;
return variables.nextWard;
}
public string function handle(numeric darkEnergy) {
if (!isNull(variables.nextWard)) {
return variables.nextWard.handle(arguments.darkEnergy);
}
return "Energy dissipated.";
}
}
component name="MinorWard" extends="Ward" {
public string function handle(numeric darkEnergy) {
if (arguments.darkEnergy < 10) return "Minor Ward absorbed the energy.";
return super.handle(arguments.darkEnergy);
}
}
component name="MajorWard" extends="Ward" {
public string function handle(numeric darkEnergy) {
if (arguments.darkEnergy < 100) return "Major Ward contained the blast.";
return super.handle(arguments.darkEnergy);
}
}
Incoming curses are routed through layers of tag-wards. If a minor ward cannot handle the dark energy, it passes the burden to the major ward. The alchemist sets the chain, unconcerned with which specific layer eventually neutralizes the threat.
Runic Tags:
#chain-of-responsibility
#coldfusion
#tribunals
#filtering