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 Associations

4.1 What is an association?

In the previous section you learnt how to identify conceptual classes and their attributes from a requirements document.

In this section you will:

  • review what is meant by an association;

  • learn how to identify associations.

Just as a class can be thought of as a set of objects that have common attributes and behaviour, so an association between two classes is a set of links that have a common meaning. You have seen that a link is a connection between a pair of objects – one from each class – that is significant for the system domain. For example, in the DVD Library System, each object may be linked to a number of objects, with each link between a single object and a single object representing a connection between a film and a DVD. The situation at a particular point in time can be illustrated by an object diagram, such as the one in Figure 9.

Figure 9 Object diagram illustrating links between and objects

The links in Figure 9 each model the fact that the particular object at one end of the link represents a DVD which ‘is a copy of’ the film represented by the object at the other end. So these links are said to be instances of an association that we might call , which exists between the classes and .

As with classes and attributes, the name given to an association should be a single word and should give an indication of the meaning of the association. The usual convention is for association names to start with a lower-case letter. Note that the name of an association does not imply anything about its direction. This means that naming the above association (meaning a film is copied by a DVD) would have been just as valid as naming it (meaning a DVD is a copy of a film).

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