
Software Design – The Visitor Pattern
The visitor pattern is the last of the behavioral ones for us to review. This is going to feel similar to some others that allow us to abstract functionality such as a command. This one provides us with a way to group functionality and avoids duplication or even sprawl of our code. The Visitor Pattern Defined As always, we will start with the “Gang of Four” intent to set the stage for our discussion. “Represent an operation to be perfomed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.” Simply put, this pattern allows us to abstract and group functions that we will be performed on... Read more