4. Representing Unidirectional Associations as Reference Properties

A unidirectional association between a source and a target class can be represented as a reference property of the source class. This is illustrated in Figure 8.3 below for two unidirectional associations: a many-to-one and a many-to-many association.

Figure 8.3. Representing unidirectional associations as reference properties

Representing unidirectional associations as reference properties
Representing unidirectional associations as reference properties
Representing unidirectional associations as reference properties

Notice that, in a way, we have eliminated the two explicit associations and replaced them with corresponding reference properties resulting in a class model that can be coded with a classical OOP language in a straightforward way. OOP languages do not support associations as first class citizens. They do not have a language element for defining associations. Consequently, an OOP class design model, which we call OO class model, must not contain any explicit association.