About 168,000 results
Open links in new tab
  1. When should I use the Visitor Design Pattern? - Stack Overflow

    The Visitor Pattern (like many design patterns) was born from the pain and suffering of developers who knew there was a better way to allow their code to change without requiring a lot of changes …

  2. java - Visitor pattern's purpose with examples - Stack Overflow

    Apr 9, 2010 · I'm really confused about the visitor pattern and its uses. I can't really seem to visualize the benefits of using this pattern or its purpose. If someone could explain with examples if possible that

  3. c++ - Visitor Pattern Explanation - Stack Overflow

    With the visitor pattern, the method that is being called ultimately depends on the type of two objects - the type of the object implementing the equipmentVisitor, and the type of the object on which you call …

  4. When should you really use the visitor pattern - Stack Overflow

    Nov 1, 2015 · In the post When should I use the Visitor Design Pattern? the first answerer states : Now we want to add a new operation to the hierarchy, namely we want each animal to make its sound. As …

  5. What is the difference between Strategy pattern and Visitor Pattern?

    A Visitor is a strategy but with multiple methods and it allows Double dispatch. The Visitor also allows for safe binding between two concrete objects at runtime. Note: This is an example written in Java. For …

  6. Confused about the Visitor Design Pattern - Stack Overflow

    Jun 3, 2021 · The code in the OP resembles a well-known variation of the Visitor design pattern known as an Internal Visitor (see e.g. Extensibility for the Masses. Practical Extensibility with Object …

  7. Difference between decorator design pattern and visitor design pattern

    Visitor design pattern is a way of separating an algorithm from an object structure on which it operates. A practical result of this separation is the ability to add new operations to existing object structures …

  8. What are the actual advantages of the visitor pattern? What are the ...

    Applying the visitor design pattern in the above way will provide double dispatch. This way you do not necessarily need additional Visit methods when adding additional types to your hierarchy. Ofcourse it …

  9. What is the point of accept () method in Visitor pattern?

    The visitor pattern's visit / accept constructs are a necessary evil due to C-like languages' (C#, Java, etc.) semantics. The goal of the visitor pattern is to use double-dispatch to route your call as you'd …

  10. oop - Alternative to the visitor pattern? - Stack Overflow

    I am looking for an alternative to the visitor pattern. Let me just focus on a couple of pertinent aspects of the pattern, while skipping over unimportant details. I'll use a Shape example (sorry!)...