ELI5: Explain Like I'm 5

visitor pattern

The Visitor pattern is like a game of tag - the object you are visiting (the Visitor) 'touches' or 'visits' the other object (the Visitee) and does something with it. In this way, the Visitor can do different things to different Visitees.

For example, let's say you have some friends and you want to sell them a bag of candy. You could go to each one of them and offer them the candy. This would be a Visitor pattern - you are the Visitor, and each of your friends is a Visitee. You can use the same offer to give candy to all of them, but each one can decide if they want to buy or not.
Related topics others have asked about: