visitor-inverts-ocp-axis

Status: IN

The Visitor pattern inverts the standard OCP extension axis: while typical OCP keeps operations closed and allows new types (add subclasses without modifying existing code), Visitor keeps the type hierarchy closed and allows new operations (add visitors without modifying elements) — making it the dual of conventional OCP and suitable precisely when operation volatility exceeds structural volatility.

Justifications

Visitor's open-ops/closed-structure stance is the precise mirror of OCP's open-structure/closed-ops stance

Depends on (SL): visitor-enables-open-ended-operations, visitor-tradeoff-stable-structure-required, ocp-open-for-extension-closed-for-modification

Depended on by

JSON