Visitor: New Jobs Without Touching Every Class

When every new job on a tree of objects (describe it, count it, check it) means a new method in every class of the tree, each job ends up scattered across all of them; the Visitor pattern puts each job in one object with a method for each kind of piece, so a new job is one new class and the pieces never change.

By

Updated

Cheat sheet: Visitor: New Jobs Without Touching Every Class
Category
Data Structures
Level
Freelancer
Tags
Double Dispatch, OOP, Open/Closed Principle, Visitor Pattern