Previous Topic: Relationship CardinalityNext Topic: Relationship Pairing Percentage


Relationship Optionality

It is important to define whether all entities must participate in a relationship membership, in which case, the relationship membership is mandatory or only some, in which case, it is optional.

For example, in the following illustration, neither relationship membership is indicated as being optional.

Customers Place Orders

From this illustration, it is possible to infer the following:

The first statement makes sense. It is unlikely that the business accept an order for its products without knowing and approving the identity of the customer placing it. Likewise, if the customer placing the order ceases to be a customer, it is reasonable that all the customer's outstanding orders cease to be treated as orders. If this is true, the relationship membership ORDER is placed by CUSTOMER is said to be mandatory.

The truth of the second statement is doubtful. Assume that the CUSTOMER entities include information about the customer's name, date of first becoming a customer, and credit rating. Further assume that a canceled order is of no further interest to the business, and so may be deleted. In this case, the business loses all knowledge of a customer whose only order is canceled. It is unlikely that this condition reflects the business reality. Rather, the business probably wants to retain knowledge of a customer whether the CUSTOMER has an active pairing with an ORDER. If this is true, the relationship membership CUSTOMER places ORDER is said to be optional.

Optional relationship memberships are drawn as a circle on the relationship line next to the cardinality symbol. The following illustration depicts CUSTOMER places ORDER as an optional relationship membership.

Customers Place Orders - Cardinality Symbol

The sentences describing the relationship memberships can now be expanded to reflect optionality, as follows:

Some analysts prefer to consider optionality a special case of cardinality that permits zero pairings. The previous two sentences would then read:

The distinction between optionality and zero cardinality, as the other alternative is named, is academic. This book and CA Gen express zero cardinality through the optionality of a relationship membership.

Entities whose pairings are all optional tend to be the more permanent ones in the business. A CUSTOMER can exist independently of the existence of entities of any other type, but an ORDER cannot exist without a related CUSTOMER.

The optionality of a relationship can be one of the following options:

The following illustration shows examples of both a fully mandatory relationship and a fully optional relationship.

Division of a relationship into memberships - Cardinality Symbol

An ORDER cannot exist without ORDER ITEMs, neither can an ORDER ITEM exist without an ORDER. On the other hand, a CAR can exist with no assigned driver, and a PERSON can exist without having a CAR to drive.

In practice, most relationships are partly optional. Some cardinality and optionality combinations are unusual and is viewed with suspicion.

Note: For more information, see the chapter Building the Analysis Model.

Often, the existence of a pairing for an optional relationship membership depends on some combination of attribute values and existence of relationship memberships. This combination is named an optionality condition.

The following types of relationship optionality conditions:

The unrestricted condition requires no explicit definition. For example, assume that the entity type PERSON has the attributes Job Title and Age. Assume also that if Job Title of a PERSON has a value of "Chauffeur," then that person must have a pairing with a CAR. This optionality condition for the relationship membership PERSON drives CAR can be represented as: Required when PERSON Job Title is equal to "Chauffeur."

Likewise, assume that if Age of a PERSON is less than the legal driving age (say, 16) then that PERSON cannot drive a CAR. This optionality condition can be represented as: Forbidden when PERSON Age is less than 16.

Note the implied constraint that a PERSON under 16 cannot be a Chauffeur.

Record these optionality conditions in the description of the relationship membership that is being affected. Later, during Interaction Analysis, these conditions can be incorporated into process specifications. See the chapter "Analyzing Interactions" for more information.

More information:

Analyzing Interactions