The Strategy
Define a family of algorithms, encapsulate each one, and make them interchangeable in the mainframe logic.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Strategy
ARCANUM SCHOOL: Evocation // Algorithm
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PLI PATTERN //
/* The Strategy */
STRATEGY: PROC OPTIONS(MAIN);
DCL 1 CONTEXT BASED(C_PTR),
2 EXECUTE_STRATEGY ENTRY;
PUT SKIP LIST('Executing dynamically selected sorting strategy...');
END STRATEGY;
By injecting function pointers into a Context structure, PL/I programs can alter their computational Strategy at runtime without recompiling.
Runic Tags:
#strategy
#algorithm
#dynamic