There are many situations where an object consists of subobjects or components. A complex
object is an item that is viewed as a single object in the ‘real world’ but combines with
other objects in a set of complex A-PART-OF relationships (APO). The objects contained
may themselves be complex objects, resulting in an A-PART-OF hierarchy. In an objectoriented
system, a contained object can be handled in one of two ways. First, it can be
encapsulated within the complex object and thus form part of the complex object. In this
case, the structure of the contained object is part of the structure of the complex object and
can be accessed only by the complex object’s methods. On the other hand, a contained
object can be considered to have an independent existence from the complex object. In this case, the object is not stored directly in the parent object but only its OID. This is known
as referential sharing (Khoshafian and Valduriez, 1987). The contained object has its
own structure and methods, and can be owned by several parent objects.