The Chain of Responsibility
Avoid coupling the sender of a request to its receiver by giving more than one module a chance to handle the request.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Enchantment // Delegation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PLI PATTERN //
/* The Chain of Responsibility */
CHAIN: PROC OPTIONS(MAIN);
DCL 1 HANDLER BASED(H_PTR),
2 NEXT_HANDLER POINTER,
2 HANDLE_REQ ENTRY(FIXED BIN(15));
PUT SKIP LIST('Passing request down the handler chain...');
END CHAIN;
By forming a linked list of handler pointers, the mainframe passes the request sequentially until a procedure successfully executes the command.
Runic Tags:
#chain
#responsibility
#handler