Abstract
We present a general technique for extending Java-like languages with dynamic overloading, where method selection depends on the dynamic type of the parameter, instead of just the receiver. To this aim we use a core Java-language enriched with encapsulated multi-methods and dynamic overloading. Then we define an algorithm which translates programs to standard Java code using only basic mechanisms of static overloading and dynamic binding. The translated programs are semantically equivalent to the original versions and preserve type safety.
This work has been partially supported by the MIUR project EOS DUE.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Ancona, D., Drossopoulou, S., Zucca, E.: Overloading and Inheritance. In: FOOL 8 (2001)
Bettini, L., Capecchi, S., Venneri, B.: Featherweight Java with Dynamic and Static Overloading. Science of Computer Programming 74(5-6), 261–278. Elsevier, Amsterdam (2009)
Bettini, L., Capecchi, S., Venneri, B.: Double Dispatch in C++. Software: Practice and Experience 36(6), 581–613 (2006)
Boyland, J., Castagna, G.: Parasitic Methods: Implementation of Multi-Methods for Java. In: Proc. of OOPSLA, pp. 66–76. ACM, New York (1997)
Castagna, G.: Object-Oriented Programming: A Unified Foundation. Progress in Theoretical Computer Science. Birkhauser, Basel (1997)
Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design rationale, compiler implementation, and applications. ACM Trans. Prog. Lang. Syst. 28(3) (May 2006)
Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001)
Ingalls, D.: A Simple Technique for Handling Multiple Polymorphism. In: Proc. OOPSLA, pp. 347–349. ACM Press, New York (1986)
Millstein, T., Reay, M., Chambers, C.: Relaxed multijava: balancing extensibility and modular typechecking. SIGPLAN Not. 38(11), 224–240 (2003)
Pirkelbauer, P., Solodkyy, Y., Stroustrup, B.: Open multi-methods for C++. In: GPCE, pp. 123–134. ACM, New York (2007)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bettini, L., Capecchi, S., Venneri, B. (2010). A Safe Implementation of Dynamic Overloading in Java-Like Languages. In: Arbab, F., Sirjani, M. (eds) Fundamentals of Software Engineering. FSEN 2009. Lecture Notes in Computer Science, vol 5961. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11623-0_29
Download citation
DOI: https://doi.org/10.1007/978-3-642-11623-0_29
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-11622-3
Online ISBN: 978-3-642-11623-0
eBook Packages: Computer ScienceComputer Science (R0)