Previous Topic: AttributesNext Topic: Confirming Analysis


Relationships

The following sections describe the various types of relationships that exist between the entities.

Transient

A transient relationship is one that is not stored. A transient relationship may, of course, be stored by adding a persistent attribute to an entity type, to hold the identifier of some other persistent entity type. The validity of this foreign identifier has to be maintained by explicit action diagram statements (in operations).

Transient relationships are "documentation only." Compare a transient relationship with a CA Gen managed relationship, in which CA Gen automatically generates foreign keys in the relationship table, and manages referential integrity using database features, or CA Gen generated code. The user has the convenience of referring to the relationship in Read actions, and performing Associate, Disassociate, and Transfer actions on the relationship.

Transient relationships can be used to show business relationships existing between persistent types, but which are not managed by CA Gen. The user must write specific logic to make relationship occurrences persistent, and to maintain referential integrity. However, the modeler may simply wish to depict a relationship in the diagram that is redundant or derivable, as an aid to understanding the diagram. In this case, there is no requirement for user logic to maintain the relationship.

One reason for not using CA Gen to implement the relationship is to achieve full encapsulation. Once two-entity types share a CA Gen managed relationship, they cannot be fully encapsulated, since a change to the implementation of one entity type impacts the implementation of the other.

Transient relationships are also useful for depicting relationships between transient and persistent types. Transient relationships allow the user to define integrity constraints involving relationships (that is, optionality, cardinality, and identifier) although Compose does not enforce such constraints.

Protected

Protected relationships are only visible to the implementations of their two participating entity types. Protected relationships can be altered, removed, or added to the implementation of their two participating entity types, without impacting the rest of the application.

Encapsulated entity types do not support CA Gen implemented relationships. Relationships involving one or two restricted entity types are automatically protected by CA Gen.

A protected relationship can only be referenced (in read statements) in the operations of the (one or two) participating entity types of that relationship. Only the owning entity type may perform DAT actions on protected relationships.