Skip to Main Content
Aggregation and containment are important concepts in object-oriented modeling. In component-based approaches to software development, aggregation and containment are touted as one of the primary mechanisms for component reuse. Containment relationships are typically implemented with object references in most object-oriented programming languages. This encourages the sharing of component objects between aggregates, but does not yield faithful representations of the containment relationships. We investigate structural relationships which are inherent in object graphs defined by inter-object references. For an arbitrary object graph, we construct an ownership tree determined by separability properties within the object graph. This tree provides a simple, yet clear definition of the interior and exterior for individual objects, capturing an appropriate notion of object containment. To be useful in dynamic systems, such structural properties need to be invariant across the behaviour of the system. We discuss connections between such structural invariants for object graphs with our related work on flexible aliasing protection.