'

Automating delegation in class-based languages

John Viega, Reliable Software Technologies, USA

Paul Reynolds, University of Virginia, USA

Reimer Behrends, Michigan State University, USA

Some designers of class-based object oriented languages choose not to support multiple inheritance. As a result, programmers often result in ad hoc workarounds. The most common of these workarounds is delegation. Even delegation is tedious and error prone, however. We believe that language designers who choose against multiple inheritance should consider automating delegation in order to alleviate these problems.

In this paper, we present Jamie, a language extension for Java that automated delegation. We also discuss tha advantages and disadvantages of both delegation and automating it in a class-based programming language. Many of our observations are based on our experiences with implementing and using Jamie.

We have used delegation extensively, especially in Java programs, and found that its use is tedious and error-prone. We therefore decided it was an ideal candidate for automation. As a result, we created Jamie, which uses a preprocessor to add a language-level delegation feature.

In the process of designing Jamie´s syntax and using our tool, we have encountered issue that language designers shold know about if they consider adding a feature like this.

Our goal in this paper is to introduce our tool and its syntax, to show that this language feature might be a suitable alternative to mupliple inheritance (especially for those who are adamant about MI) and to identify language design issues surrounding this issue.'