Visitor Design Pattern

Get an overview of the visitor design pattern.

Overview

We often have object structures in our programs. For example, we might have objects in an interface that’s implemented by various concrete classes. Sometimes, we want to add functionality to this object structure. We might be tempted to add a method for each additional functionality to the interface. However, this could violate the single responsibility and the ...