The Command
Encapsulate a request as an object, thereby letting you parameterize clients with different requests.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Command
ARCANUM SCHOOL: Enchantment // Command
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PLI PATTERN //
/* The Command */
COMMAND: PROC OPTIONS(MAIN);
DCL 1 CMD BASED(C_PTR),
2 EXECUTE ENTRY,
2 UNDO ENTRY;
PUT SKIP LIST('Command queued for batch processing.');
END COMMAND;
The Command pattern shines in PL/I batch processing, where tasks are encapsulated in structures holding function pointers and state for deferred execution.
Runic Tags:
#command
#batch
#encapsulation