builder-visitor-dual-structure-traversal-patterns

Status: IN

Builder and Visitor share notable structural parallels as traversal-oriented patterns: both accumulate state across a sequence of steps, both can operate without requiring a common parent class for the things they process (Builder's products need not share a hierarchy; Visitor can traverse heterogeneous elements), and both can serve analytical purposes beyond their primary construction or visitation roles — Builder can analyze structure without creating a product, while Visitor can compute collective properties across a traversal. These similarities suggest a duality in how each pattern decouples a step-wise protocol from what is done at each step.

Justifications

Builder (construct-time traversal) and Visitor (use-time traversal) are structural duals sharing accumulation, protocol decoupling, and parent-independence

Depends on (SL): builder-maximally-decoupled-from-product, visitor-accumulates-across-structures

Depended on by

JSON