Featherweight Java with multi-methods

  • Authors:
  • Lorenzo Bettini;Sara Capecchi;Betti Venneri

  • Affiliations:
  • Università di Firenze;Università di Catania;Università di Firenze

  • Venue:
  • Proceedings of the 5th international symposium on Principles and practice of programming in Java
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Multi-methods (collections of overloaded methods associated to the same message, whose selection takes place dynamically instead of statically as in standard overloading) are a useful mechanism since they unleash the power of dynamic binding in object-oriented languages, so enhancing re-usability and separation of responsibilities. However, many mainstream languages, such as, e.g., Java, do not provide it, resorting to only static overloading. In this paper we propose an extension, we call FMJ (Featherweight Multi Java), of Featherweight Java with encapsulated multi-methods thus providing dynamic overloading. The extension is conservative and type safe: both "message-not-understood" and "message-ambiguous" are statically ruled out. Our core language can be used as the formal basis for an actual implementation of dynamic overloading in Java-like languages.