No Multiple Dispatch In Java

Adding Multiple Dispatch to Java would necessitate massive changes to the core libraries and a completely new approach to the design of Java programs. I think you're asking for a whole new language! Perhaps you'd be better off programming in the Dylan Language.

Why would it? It would require changes if Multiple Dispatch was automatic, but it ain't necessarily so. In Common Lisp, for example, you only get Multiple Dispatch if you ask for it, by making a generic function. In much the same way, you could apply the same rule in Java.

A compatible extension of Java with Multiple Dispatch is the Nice Language.


Multiple Dispatch can lead to ambiguity if the methods in question take more than one argument; this ambiguity could be resolved with a set of rules for which one would take precedence, but overall, I prefer No Multiple Dispatch In Java.

See original on c2.com