Hygienic methods — Introducing HygJava.
Jarosław D. M. Kuśmierek, Viviana Bono · The Journal of Object Technology · 2007
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.