4.2.3 Associations and generalisation relationships
Before moving on, it is worth considering briefly the implications of generalisation relationships for associations.
As with attributes, any associations involving a parent class will be inherited by its child class(es). Figure 12 shows two associations involving : connecting it to , and connecting it to . The meaning of these associations is that any doctor (whether a junior doctor or a consultant doctor) may be linked to a team or to patients or both.
Notice that by including the class the structure is simplified. If were omitted, would need to be replaced by two associations, one between and , and the other between and ; there would be similar ‘duplication’ of the association.
Because inherits an association with from its parent class, , there are two different associations between and : and . This is fine, but it does have some implications for the consistency of the model, in that a team must contain the consultant doctor that heads it. We will return to this later in the course.