Modelling object-oriented software – an introduction
Modelling object-oriented software – an introduction

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

Modelling object-oriented software – an introduction

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.

M256_1

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371