Check out the new USENIX Web site. next up previous
Next: Acknowledgments Up: Using Accessory Functions to Previous: Related Work


Conclusions

Current single-dispatch object-oriented languages provide dynamic dispatch only for functions listed in the class involved in dispatch, even if overloading is allowed for other parameters. This property gives the author of a class the responsibility of enumerating all cases in which dynamic dispatch is needed for objects of this type. This hinders code reuse by forcing the designer of a set of types to choose between allowing reuse by inheritance (by using dynamic dispatch) and reuse in a function (by using explicit switches on the kind of object).

It is possible and (we believe) desirable to provide dynamic dispatch to users of a class hierarchy. In other words, we should eliminate the coupling between dispatch method and membership in (and access to) a class. This decoupling lets programmers achieve both reuse by inheritance and reuse in a function. Thus, our ``accessory functions'' improve the support for both reuse and data encapsulation, and can be implemented with the same efficient dispatch algorithms used in current C++ virtual function selection.




2000-12-09