A uniform mechanism for building containment hierarchies separates the
code/method which actually perform the containment insertion operations on
the components from the specification of the containment and then provides
an automatic way of obtaining and executing that code when containment
hierarchies need to be created. The mechanism consists of an abstract
syntax for describing the containment relationships, processing mechanism
for creating the containment mechanism, and a registry containing the
mechanisms for implementing specific containment policies. Having this
abstraction allows an application programmer to be able to construct
hierarchies of objects without having to be concerned about the specific
details of how that containment is performed. In fact, the details may be
deferred until run-time (and even downloaded from elsewhere). Also, having
this abstraction significantly simplifies automatic generation of object
hierarchy codes, both from the point of view its implementation as well as
that of the code that is generated.