The three example apps that we have discussed in Volume 1, the minimal app, the validation app, and the enumeration app, have been limited to managing the data of one object type only. A real app, however, has to manage the data of several object types, which are typically related to each other in various ways. In particular, there may be associations and subtype (inheritance) relationships between object types. Handling associations and subtype relationships are advanced issues in software application engineering. They are often not sufficiently discussed in text books and not well supported by application development frameworks.
Associations are important elements of information models. Software applications have to implement them in a proper way, especially in their model layer within a model-view-controller (MVC) architecture. Unfortunately, application development frameworks do often not provide much support for dealing with associations.
There are two important distinctions, which are independent of each other:
Functional versus non-functional ("many-to-many") associations.
Unidirectional versus bidirectional associations.
A functional association corresponds to what is called a function in mathematics, while a many-to-many association corresponds to what is called a relation in mathematics.
A unidirectional association corresponds to a reference property in OO modeling and programming, while a bidirectional association corresponds to a pair of mutually inverse reference properties.