I am reading about visitor pattern, and it appears the same like Double Dispatch. Is there any difference between the two. Do the two terms means the same thing.
re
Dynamic Dispatch refers to the concept of dispatching to a method based on runtime information, in general. Most OO systems (as in Java/C#/C++) usually implement dynamic dispatch via virtual
methods (whether or not all methods are virtual depend from the language); this restricts them to dispatch according to a single method argument (the implicit object reference).
In general you could want to dispatch according to an arbitrary number of elements. Double Dispatch, for example, is the requirement/ability to dispatch according to two arguments of the method.
On the other hand, the Visitor Pattern is an implementation of Multi Dispatch in general and thus Double Dispatch in particular in such OO systems.