First-class composition inheritance is a significant improvement over other inheritance techniques with respect to reuse. It allows a class to be used as a component to build other classes, enabling a new kind of reuse. Frequently used characteristics and collaborations, such as bounded values and associations, can be encapsulated in classes and reused conveniently to build other classes.
In this paper, we present the O2 calculus, which supports first-class composition inheritance. It models multiple subclassing inheritance, first-class composition inheritance, renaming and merging, direct and indirect inheritance, subobject references, and component parameters. Our approach differs from existing calculi in that O2 is parametric in its inheritance mechanism. We define a signature for the inheritance mechanism that captures its required functions and axioms. The type soundness proof must not be reverified if the inheritance mechanism is modified or replaced, as long as it implements the inheritance signature.