Eliminate Unidirectional Associations

Let’s learn how to eliminate unidirectional associations for our class models.

We'll cover the following

Classical OO programming languages don’t support associations as first-class citizens, but only classes and reference properties representing unidirectional associations. That’s why we have to eliminate all explicit associations from general information design models to obtain OO class models.

The basic elimination procedure

The starting point of our restricted association elimination procedure is an information design model with various kinds of unidirectional associations. If the model still contains any non-directional associations, we first have to turn them into directional ones by making a decision about the ownership of their ends.

A unidirectional association connecting a source with a target class is replaced with a corresponding reference property in its source class. That source class must meet the following conditions:

  1. It should have the same name as the association end, if there is any. Otherwise, use the name of the target class and pluralize it if the reference property is multi-valued.
  2. The target class should be set as its range.
  3. The same multiplicity should be set as the target association end.
  4. A uniqueness constraint should be added if the unidirectional association is inverse functional.

This replacement procedure is illustrated in the case of a unidirectional one-to-one association shown below. In this example, the uniqueness constraint of the chairedCommittee reference property is expressed by the {key} property modifier.

Get hands-on with 1200+ tech skills courses.