Hygienic methods — Introducing HygJava

By: Jaroslaw D. M. Kúsmierek, Viviana Bono


One of the base concepts of object-oriented programming is that of “method”. In languages supporting inheritance, this concept is realized by three different actions: ( i ) the introduction of a new method; ( ii ) the implementation/override of an existing method; ( iii ) the method call. The bindings between ( ii ) and ( i ), and between ( iii ) and ( i ) are typically based on method names, which are not guaranteed to be unique, thus such bindings might cause some ambiguities. As a result, modifications of existing code may cause errors in some other parts of the code, especially in programs written by third party developers; overall, a programmer cannot predict the moment in the execution when such ambiguities will arise. In this paper, we describe the nature of these problems and propose a general mechanism to overcome ambiguities in a safe, straightforward, and flexible way. To study the details of this mechanism, and make the reader more familiar with it, we show how to apply this mechanism to Java, and also to a mixin-oriented language called MixedJava.

Cite as:

Jaroslaw D. M. Kúsmierek, Viviana Bono, “Hygienic methods — Introducing HygJava”, Journal of Object Technology, Volume 6, no. 9 (October 2007), pp. 209-229, doi:10.5381/jot.2007.6.9.a11.

PDF | HTML | DOI | BiBTeX | Tweet this | Post to CiteULike | Share on LinkedIn

The JOT Journal   |   ISSN 1660-1769   |   DOI 10.5381/jot   |   AITO   |   Open Access   |    Contact