9.5 aggregates

OODBTG Reference Model

"Aggregate objects" such as sets, bags, lists, tuples, arrays,etc.,\footnote{These are logical constructs distinct from implementation-specificdata structures.} are containment constructs that group other objects organizedin some manner. Aggregates typically support operations to access individualmembers, and to iterate over all members, as in queries. Aggregates maybe "homogeneous", containing only objects from the same classor from classes inheriting from the same class, or they may be "heterogeneous",containing objects from any class.

With respect to identity, there are two kinds of aggregate objects."Intensional" aggregates have an identity based upon their creationevent. "Extensional" aggregates have an identity based upon theirmembership. If X and Y are the LIDs of extensional sets, then X == Y isequivalent to X and Y having the same members. For an intensional set,the membership at any time corresponds to an extensional set. Two intensionalsets remain distinct objects if they have the same members. If the membershipof an intensional set changes, the identity of the set does not change.


Not addressed.


Structured objects (aggregates) can be of type Structure or type Collection.Structures are records with named slots which can be filled by objectsor literals of different types. Collections are homogeneous (modulo subtyping)groupings of elements that may or may not be ordered.

Built-in collection types are set, bag, list and array. Sets and bagsare unordered collections; lists and arrays are ordered. Arrays are variablelength (although an initial size is specified at creation) and can containnil values.

Collection types are instances of parameterized types. They can be parameterizedby any subtype of Denotable_Object. There are two subtypes of collections:predicate_defined and insertion_defined. A type extent is a predicate_definedcollection.

Mutable collections (subtype of Structured_Object) have intentionalsemantics. Immutable collections (subtype of Structured_Literal) have extensionalsemantics.

Iterators can be defined to traverse collections. Type Collection alsodefines predicate-based select operations. Query operations apply to anycollection (extents, user-defined). The result of a selection is a subcollectionof the same type as the collection queried. Each of the more specific collectiontypes defines appropriate query operations. Of course, the literal collectiontypes do not define update operations (insert, delete, replace).


The aggregation types are array, bag, list and set. Arrays and listscan optionally require that their elements are unique, essentially providingindexed and ordered sets, respectively. This uniqueness and that of a setis based on deep comparison and not on instance identity. Aggregates inEXPRESS are extensional: an aggregate value has no identifier of its own.

Open Distributed Processing

In ODP, aggregates would likely be treated as a composition of object(i.e., a new object) with a particular behavior.

Management Information Model

Not applicable.


SQL3 provides row types as literal structures. Instances of row typescan be used as values in tables; row types can also be nested. A numberof predefined parameterized collection types are also defined. A collectionmay be specified as SET(<type>), MULTISET(<type>),or LIST(<type>). In each case, the <type>parameter (called the element type) can be a predefined type, anADT, a row type, or another collection type. For example SET(INTEGER)and SET(LIST(INTEGER)) would both be validdeclarations, as would SET(movie) and SET(LIST(movie)),where movie is some previously defined ADT.At present, the element type cannot be a reference type, nor can it bea named row type containing a field whose type is a reference type.

A collection can be used as a simple table in queries. In this case,each element of the collection corresponds to a row in the table. The tableis treated as having a single column whose type is defined by the typeof the instances of the collection. Since collection types are data types,they must be declared as the types of table columns in order to store instancesof collections persistently in the database.


Matisse literals support aggregates as lists and arrays. Class relationshipssupport a list of OIDs specifying links to other objects. Any type of aggregatecan be supported, but the user must specify the behavior by supplying theappropriate links and triggers.


C++ supports C aggregate types (arrays, structs, and unions) in additionto (object) classes. A C++ struct is considered as a class without defaultaccess restrictions. Additional aggregate types can be defined using classtemplates. See 7. Types and Classes.


Ordinary COBOL aggregates are supported. The definition of parameterizedcollection objects is being investigated.


See entry under 9.4 containment.


Aggregate objects are realized through generic types. A class may bedeclared with a number of formal generic parameters that specify the typeof objects that it can operate on. For example, the HASH_TABLE class inEiffel has the following class header:

Both T and U are generic parameters. Code within the class can referto both of these parameters as types. The parameter U is restricted bythe class HASHABLE. i.e., U must conform to HASHABLE. In this class T isthe type of object that will be stored in the structure while U is thetype of the key used in the storage management.

Such generic aggregate types include linked lists, hash tables, setsand so on. However these are not defined by the language, but are suppliedas class libraries.


SELF supports two special aggregates: object arrays and byte arrays.Arrays contain only a single parent slot pointing to the parent objectfor that kind of array, but contain a variable number of element objects.Byte arrays differ from object arrays in supporting a special compact storageformat.

System Object Model (SOM)

Aggregation is used in SOM to represent collections of basic data types.The aggregation types as expressed in C are struct, union and enum.

OLE Component Object Model

See entry under 8. Inheritance and Delegation.

Analysis and Design Methods

[Note: The contributor takes 'aggregation'to refer to the mechanism whereby a (composite) object has relationshipsto other objects, which relationships mean that it is composed of the other(component) objects. (Strictly, that the composite object represents somethingcomposed of other things represented by the component objects). This sensecorresponds to the implementation whereby a composite object consists of,or otherwise maintains access to, the identifiers of a fixed number (ora variable number, zero or more) of other objects (thinking of the onlypossible composition mechanism in Smalltalk). Most authors use the termin this sense.]


CA: Classes may be organized in whole-partstructures.

RA: "Aggregation is a strong formof association in which an aggregate object is made of components.Components are part of the aggregate. The aggregate is semanticallyan extended object that is treated as a unit in many operations, althoughphysically it is made of several lesser objects." "Aggregationis a special form of association, not an independent concept."

JA: "A special type of acquaintanceassociation [See 9.1 Relationship.] is the consists-of association,which is used to express that an object is composed of other objects. Sucha structure where a uniting object has associations with participatingparts is sometimes called an aggregate."

WD: Aggregation is modeled by the "is-part-of"relationship. A distinction is made between "composite classes"and "container classes." A composite class has responsibilitieswith respect to its parts and will commonly collaborate with or delegateto them. An example is car, composed of wheels and other parts. A containerclass has a weaker relationship to its contents. Examples are array andhash table. Instances of both kinds of classes are, of course, objects;however, container classes are designed specifically to model containment.

MD: Aggregates are to be found in orbuilt for a library.

EA: The is part of "relationshipset declares that an object, called a superpart or aggregate, is composedof other objects called subparts or components."

FA: "Aggregation: a mechanism forstructuring the object model whereby a new class in constructed from severalother classes and [(optionally)] relationships." "An aggregationmay be used to 'wrap up' a relationship. In this case the tuples of theaggregate must respect the contained relationship."

OA: "Composition (also referredto as aggregation) is a mechanism for forming a whole from component parts."Types of composition are distinguished and discussed in detail.

BD: "Aggregation denotes a whole/parthierarchy, with the ability to navigate from the whole (also called theaggregate) to its parts (also known as its attributes). In this sense,aggregation is a special kind of association."

HA: "Aggregation structures representthe is-part-of relationship."

NA: "An aggregation relations betweena client class and a supplier class is a special case meaning that wheneveran i

features matrixintro page