Search⌘ K

Unidirectional Associations

Explore how to represent unidirectional associations between classes as reference properties in JavaScript. Understand directionality decisions in UML designs and how to implement many-to-one and many-to-many associations effectively in object-oriented front-end applications.

Represent unidirectional associations

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 the diagram for the two unidirectional associations (a many-to-one and a many-to-many association) listed below:

Notice that, in a way, we’ve eliminated the two explicit associations and replaced them with corresponding reference properties. This results in a class model that can be coded with a classical OOP language in a straightforward manner. Object-oriented programming languages don’t support associations as first-class citizens. They also don’t have a language element for defining associations. Consequently, an OOP class design model, which is sometimes called OO class model, must not contain any explicit association.

Add directionality to a non-directed association

When we make an information model in the form of a ...