Skip to content

Commit 72bc96f

Browse files
committed
Added to FAQ: "What is the difference between Visitor and Double Dispatch patterns?"
1 parent 955c88e commit 72bc96f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,11 @@ The difference is the intent of the patterns. While Proxy controls access to the
659659

660660
While the implementations look similar there are differences. The Chain of Responsibility forms a chain of request processors and the processors are then executed one by one until the correct processor is found. In Intercepting Filter the chain is constructed from filters and the whole chain is always executed.
661661

662+
**<a id="Q5">Q: What is the difference between Visitor and Double Dispatch patterns?</a>**
663+
664+
The Visitor pattern is a means of adding a new operation to existing classes. Double dispatch is a means of dispatching function calls with respect to two polymorphic types, rather than a single polymorphic type, which is what languages like C++ and Java support directly.
665+
666+
662667

663668
# How to contribute
664669

0 commit comments

Comments
 (0)