jargon

Design patterns·Who calls whom, and when

the method that runs depends on the runtime types of two objects, and one call was not enough to get there.

Double dispatch

Also calleddouble-dispatch, multiple dispatch

Selecting behaviour on the runtime types of two participants rather than one, which single-dispatch languages cannot do directly. The visitor pattern is the standard workaround: the element calls a method on the visitor named for its own type, so two virtual calls together do what one could not. Knowing the mechanism is what makes the visitor's odd accept-and-call-back shape stop looking arbitrary.

Commonly confused with