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

3.2.3 Use cases

The DVD Library System will provide support to the library by enabling the library staff to do the following:

  • A: Get Number Available. The staff member identifies the film. The system displays the number of copies available.

  • B: List Films. The staff member identifies the member. The system displays a list of the film titles and return dates for the DVDs that the member has on loan.

  • C: Borrow DVD. The staff member identifies the DVD and the member who is borrowing it. The system records the fact that this copy of the film is no longer available for loan, the fact that it is on loan to the member identified, and the date on which it was borrowed.

  • D: Return DVD. The staff member identifies the DVD. The system records the fact that this copy of the film is now available for loan and that it is no longer on loan to the member who returned it.

Choosing the nouns and noun phrases is not an exact science. For example, in the second sentence of the above description, the object of the verb ‘have’ is the noun phrase ‘any number of copies of each film’. Instead of underlining this phrase as a whole we have chosen to identify ‘number of copies’ and ‘film’ separately within the phrase. In doing this we are intuitively deciding that both copies and films are likely to be of importance. Another example is the noun ‘loan’, which could be treated as part of the phrase ‘is on loan to the member’ (describing the status of a DVD) rather than as a noun in its own right. This is only the first stage of identifying classes. We will shortly analyse the candidate classes in more detail.

Some of the nouns and noun phrases underlined are duplicates, and some simply provide different ways of referring to the same thing. For example, ‘member’ and ‘library member’ clearly refer to the same kind of entity, as do ‘title’ and ‘film title’. Such synonyms need to be grouped together to identify the distinct ‘things’ that might help identify potential classes. (A synonym for a word or phrase is another word or phrase that means the same as the first, and can be used in its place.) On the other hand, the same word may be used to refer to different things; for example ‘number’ is used to refer to the unique identifying characteristic of both DVDs and members, as well as occurring in the phrases ‘number of films’ and ‘number of copies available’.

Activity 1

By grouping together nouns and noun phrases that are synonyms, list all the distinct entities that are mentioned in the requirements for the DVD Library System.

Discussion

Here is our list:

  • library (also referred to as ‘DVD Library’)

  • DVD (also referred to as ‘copy’)

  • number of films

  • number of copies

  • film

  • system (also referred to as ‘DVD Library System’)

  • title (also referred to as ‘film title’)

  • member (also referred to as ‘library member’)

  • loan

  • day

  • identifying number

  • membership number

  • member's name

  • library staff (also referred to as ‘staff member’)

  • number of copies available

  • list

  • return date

  • fact

  • date on which it was borrowed

There are a couple of things worth noting about this list:

  • We have used a singular noun or noun phrase to represent each group of synonyms. This is a step towards assigning class names, which are always singular.

  • In the system domain, ‘DVD’ – a physical video disc – is synonymous with ‘copy’. The copies of the films are held on DVDs. (In other contexts, ‘copy’ might be synonymous with a recording on some other medium, e.g. a videotape or reel of celluloid). The DVDs – or copies – need to be distinguished from the films themselves, which are intangible. There may be many DVDs of a single film in the library.

The solution to Activity 1 has advanced the process of identifying the classes needed to model the system domain. In other words, it has resulted in a list of candidate classes. For example, the second item in the list, DVD, suggests that all the DVDs in the library might be modelled by means of a DVD class; every individual DVD entity would be modelled by an instance of this class. However, there clearly remains some weeding out to be done; not all the items in the list will give rise to appropriate classes. Unfortunately, there is no mechanical technique for doing this: no set of criteria could adequately deal with the complexities and vagaries of natural language. Your ability to select appropriate classes will improve with experience, but below are some guidelines that should help you to narrow down an initial list.

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