The Visitor
Represent an operation to be performed on the elements of an object structure without changing the classes of the elements on which it operates.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Visitor
ARCANUM SCHOOL: Divination // Traversal
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PLI PATTERN //
/* The Visitor */
VISITOR: PROC OPTIONS(MAIN);
DCL 1 ELEMENT BASED(E_PTR),
2 ACCEPT ENTRY(POINTER);
DCL 1 VISITOR_STRUCT BASED(V_PTR),
2 VISIT_ELEMENT ENTRY(POINTER);
PUT SKIP LIST('Visitor traversing the syntax tree...');
END VISITOR;
The Visitor double-dispatches through structures and pointers, separating the logic of operations from the structural hierarchy of the mainframe data.
Runic Tags:
#visitor
#traversal
#operation