Previous Topic: Mutually Exclusive RelationshipsNext Topic: General Integrity Constraints


Alternative Relationship Representations

The way of handling relationships in CA Gen appears to be different from some traditional entity relationship modeling approaches.

In CA Gen, only entity types can have attributes. The relationship memberships are considered to be details of entity types; not objects in their own right. A relationship can therefore never have an attribute. Usually, if you feel the need to add an attribute to a relationship, you have discovered a new entity type (probably a conceptual or active one).

In CA Gen, a relationship has exactly two memberships; two and only two entities can participate in a single pairing. This style of relationship is named a binary relationship. Other modeling approaches allow the appearance of three or more entities in a single relationship occurrence. The term "pairing" makes no sense in this context. That style of model is said to support n-ary relationships. Using CA Gen, a relationship that appears to require more than two memberships is replaced by an entity type. An entity type that is introduced for this reason is named an associative entity type.

For example, consider the following illustration.

Alternative Relationship Representations

This illustration shows a three-membership relationship between PERSON, VEHICLE, and RENTAL LOCATION, which represents a leasing arrangement.

Because traditional modeling approaches allow only two memberships in a relationship, a fourth entity type, Rental, and some new relationships, must be added to model the business reality. In practice, you find further attributes of RENTAL, such as Start date, Start time, Rental period.

The resulting relationships, which are shown in the following illustration, are now all binary.

Alternative Relationship Representations (2)

Although the approach of representing relationships (binary with no attributes) in CA Gen initially appears restrictive, it greatly simplifies the operations on relationships that are specified during interaction analysis. Because you can model the same set of real world instances using either style of modeling, and operations on model objects are much less complex, the binary/no-attribute style of relationship modeling is superior in the context of analysis.