# 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.

![Cheat sheet: Visitor: New Jobs Without Touching Every Class](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/26da258c3d804d0e9523ee1ac8a374a9.webp)

- Category: Data Structures
- Level: Freelancer
- Tags: Double Dispatch, OOP, Open/Closed Principle, Visitor Pattern
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-visitor-cheat-sheet
