Models and modelling
Models and modelling

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.

6.8 Sharing behaviour between use cases

For each use case there may be more than one scenario. In the process of requirements elicitation and specification, you may find a certain amount of common behaviour in two or more of your use cases. You may even find that an existing component can provide part or all of that common or shared behaviour. Indeed, if you do find such an existing component, this is an example of reusing requirements which is discussed more fully in MRP.

You can record the shared behaviour in a new use case and connect it to the use cases that it came from with an open-headed, dashed arrow pointing from the original use case to the new one. Think of the new use case as always being included in each of the originals. Hence the dependency arrow is labelled with the «include» stereotype. Figure 5 shows some examples from the hotel domain (rooms are not normally allocated until a guest checks in for a variety of reasons: rooms need servicing, guests extend their stay, and so forth). The «include» stereotype simply shows that a use case can contain one or more ‘sub’ use cases and that some such sub-use cases can be reused in two or more use cases.

Figure 5
Figure 5 Shared behaviour in a hotel system

The check for available rooms sub-use case is a shared piece of behaviour, a common scenario, which can be developed separately from other use cases. Note that this is unconditional behaviour – the check for available rooms sub-use case must be performed whenever a reservation is made or a guest checks in.

By taking out any common or shared behaviour, you can benefit from a simplification of the original use cases and make them easier to understand. There is a further benefit in terms of the internal consistency of the final requirements specification. Instead of having two or more different scenarios for a room availability check, for example, there will be just one main success scenario for the new room availability check use case as shown in Figure 5.

In addition, there is a chance to consider the reuse of existing components and also the potential identification of new components.

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