The Factory Method
Defer the instantiation of a specific utility ward to runtime conditions.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Job Control Wards
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
//FACTMETH JOB (ACCT),'FACTORY METHOD',CLASS=A,MSGCLASS=X
// SET UTIL='SORT'
//*
//IF1 IF '&UTIL' = 'SORT' THEN
//STEPSORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TEKROM.RAW.MANA,DISP=SHR
//SORTOUT DD DSN=TEKROM.REFINED.MANA,DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
SORT FIELDS=(1,10,CH,A)
/*
// ENDIF
//*
//IF2 IF '&UTIL' = 'COPY' THEN
//STEPCOPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=TEKROM.RAW.MANA,DISP=SHR
//SYSUT2 DD DSN=TEKROM.REFINED.MANA,DISP=(NEW,CATLG,DELETE)
//SYSIN DD DUMMY
// ENDIF
The Factory Method
In the realm of Job Control Wards, the Factory Method empowers the ritual’s execution path to dynamically select the appropriate utility to perform a task. By evaluating the symbolic runes passed to the job, the mainframe’s JCL interpreter decides whether to invoke the arcane SORT utility or the straightforward IEBGENER copying ritual, effectively deferring instantiation logic to the conditional construct.
Runic Tags:
#factory-method
#jcl
#if-then-else
#symbols