The Chain of Responsibility of Error Wards
Pass computational anomalies along a chain of magical handlers.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Divination // Flow
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MATLAB PATTERN //
classdef (Abstract) AnomalyHandler < handle
properties
NextHandler
end
methods
function setNext(obj, handler)
obj.NextHandler = handler;
end
function handle(obj, anomaly)
if ~obj.resolve(anomaly) && ~isempty(obj.NextHandler)
obj.NextHandler.handle(anomaly);
end
end
end
methods (Abstract)
resolved = resolve(obj, anomaly)
end
end
Chain of Responsibility
Let the singularity be passed down the chain until a handler can nullify its destructive potential.
Runic Tags:
#chain
#anomaly
#wards