The fact that Bjarne Stroustrup, the creator of C++, is one of the authors suggests that this paper on the C++ open multi-methods approach has validity. The authors ensure that the new approach supports C++ call-resolution semantics. Additionally, the work includes the changes to the C++ compiler, which are required for implementation.
The paper addresses how object-oriented languages determine the method to invoke using a single runtime parameter. However, situations exist when the choice of function/method relies on two or more parameters. Additionally, these methods must be declared within class definitions, and programmers who design classes do not usually have enough information regarding the program’s future use to address all issues that might arise at runtime. The authors believe that by separating classes and operations, static or dynamic dispatch can be chosen for each parameter at runtime.
The authors discuss the following:
- Open-methods programming styles;
- Their function call for open methods and ambiguity resolution;
- Open methods in relation to other language characteristics;
- Required C++ compiler changes and extensions to the IA-64 object model;
- Other techniques that support multi-methods for C++; and
- Open multi-methods and the visitor pattern.
The results show that the authors’ open multi-methods approach is a significant improvement over existing techniques. Furthermore, the open multi-methods approach is only 16 percent slower than a current single dispatch approach. Open multi-methods can be applied to both hard real-time systems and embedded systems.