The term subobject is used in object-oriented programming
. A subobjectis understood to be a subobject of a complex object, i.e. the value of an attribute with object type
. In object-oriented design, a distinction is made between exclusive and common subobjects.An exclusive
subobjectis specifically understood to be a subobject that is used exclusively in a complex
object.Because of this exclusive use, the existence of exclusive subobjects is generally linked to the existence of complex objects. An exclusive subobject is therefore created and deleted together with its superordinate complex object.
A common subobject is a subobject that can be used simultaneously in several complex objects. Because of this multiple use, the existence of a common subobject is independent of the existence of complex objects. A common subobject is therefore created and deleted independently of its superordinate complex objects.