Multiple Dispatch ≠ Method Overloading¶

In Java or C++ you can provide these virtual methods:

Parent this: f(Parent that) Parent this: f(Child that) Child this: f(Parent that) Child this: f(Child that)

Dispatched on this but not on that

can dispatch on both using the double dispatch pattern

However, quoting Double Dispatch is a Code Smell:

The presence of Double Dispatch generally means that each type in a hierarchy has special handling code within another hierarchy of types. This approach to representing variant behavior leads to code that is less resilient to future changes as well as being more difficult to extend.

Something smells, but it's not necessarily the double dispatch