The visitor design pattern allows us to perform operations on an object without altering its structure. Essentially, we can add functionalities to an object with it changing the original object structure. An example is when a person goes to a hair salon and asks for a haircut. Once in the chair, the parameters of what is desired are changed. This does not change the structure of the operation; it just adds new functionality such as having hair colored as well as cut and styled.
Using object-oriented programming, we can extend the visitor design pattern so it affects the way inheritance works. We can extend a class and then add functionality to it in a child class.