CW 439

Marko van Dooren and Eric Steegmans
Abstract data type components

Abstract

Although abstract data types are the foundation of object-oriented programming, the use of application independent ADTs as components for other ADTs is surprisingly difficult. No existing language allows the ADTs of high-level design elements like associations, bounded values, graphs, ... to be reused conveniently as components. As a result, their instance variables and methods are implemented over and over again.

To allow such elements to be reused, we raise the abstraction level of the language by introducing a new multiple inheritance mechanism with two relations: is-a and has-a. The is-a relation is for subtyping and code inheritance, and is tailored for classification. The has-a relation is for code inheritance only, and is tailored for composition of ADTs. Using this inheritance mechanism, the implementation of the foundation of a program becomes a trivial task. A case study shows a decrease in the size of the code by 22%, while the second best inheritance mechanism gets no further than 5%. In addition, the mechanism reduces the dependency between the implementation of a class and its hierarchy.

We present a formal model of the inheritance mechanism, along with a proof of type soundness.

report.pdf (1.0M) / mailto: M. van Dooren