Software Composition with Multiple Nested Inheritance
Nathaniel Nystrom, Xin Qi, Andrew C. Myers · 2006
Abstract. This paper introduces a programming language that makes it convenient to extend large software systems and even to compose them in a modular way. JX/MI supports multiple nested inheritance, building on earlier work on nested inheritance in the language JX. Nested inheritance permits modular, type-safe extension of a package (including nested packages and classes), while preserving existing type relationships. Multiple nested inheritance enables simultaneous extension of two or more classes or packages, composing their types and behavior while resolving conflicts with a relatively small amount of code. The utility of JX/MI is demonstrated by using it to construct two composable, extensible frameworks: a compiler framework for Java, and a peer-to-peer networking system. Both frameworks support composition of extensions. For example, two compilers adding different, domain-specific features to Java can be composed to obtain a compiler for a language that supports both sets of features. 1