Relations

The Server library includes a set of class templates that let you define sophisticated relations among C++ objects. Server relations are implemented through smart pointers, a feature that helps maintain— automatically and transparently—the referential integrity of an object structure. These relations can be inverted to facilitate navigation through the object structure.

This chapter is divided as follows:

  • Ownership and Use Relations introduces the concepts of ownership relations and use relations between objects and entities, and highlights the differences between them.

  • One-to-one Relations explains how an ownership- or a use relation can link one instance of a server object type and to one instance of another server object type.

  • One-to-many Relations describes the three categories of relations that link one instance of a server object type to several instances of another server object type.

  • List-relations describes the one-to-many relation that links one object to a simple or sorted sequential list of target objects.

  • Set-relationsdescribes the one-to-many relation that links one object to a non-ordered set of target objects.

  • Array-relations describes the one-to-many relation that links one object to a table of target object values.

  • Inverting Relations explains how you can invert a relation by maintaining one or more back pointers to the origin(s) of this relation.

  • Integrity Checks explains how to check the integrity of the model with respect to how ownership- and use relations are defined within this model.