3 OBJECT ORIENTED ANALYSIS
3.2 USE CASE MODELLING
Exercise 2
Identify two sub-classes for the STUDENT class shown above in Fig 3.3. For each of the sub-classes identify two attributes and two methods which would not be in the super-class student.
Exercise 2 feedback
Sub-class Attributes Methods
Undergraduate student Personal tutor Student status
Assign personal tutor Amend status Postgraduate student Research group
Research supervisor
Add supervisor Amend research group
Full-time and Part-time students could also be considered for sub-classes of STUDENT.
Object relationship diagrams provide an overview of the system objects and how they interact, and can provide a useful overview of the system.
STUDENT Studies MODULE Teaches LECTURER
Fig 3.5 Object relationship diagram
“Ask the guest what type of room they would like and how long they wish to stay. Check the bookings system to see what rooms are available. Confirm a room and dates with the guest. Enter the booking details on the system.”
Note how this is written from the point of view of the system user (the receptionist). However, consider what happens if the receptionist is unable to offer a room of the type requested.
Another scenario can be specified to deal with this situation, for example the guest may be offered a different grade of room. The “Book Room” use case would consist of the main success scenario (expected to deal with most cases) and an extension scenario to deal with the exception. (Note There may be a number of extension scenarios depending on the situation).
Book Room Main success scenario
1. Ask guest what type of room they require 2. Check bookings system for room availability 3. Confirm room booking with guest
4. Update the bookings system.
Extensions (additional scenarios or exceptions) 1a. Room type not available
1a1. Identify alternative available room type 1a2. Return to step 3 in the main success scenario.
Fig 3.6 A simple use case description
Although a simple description similar to the one above may be suitable for a simple use case or for a small system, for more complex systems, analysts often produce a more comprehensive description which includes additional information. The following template illustrates this for the scenario above.
Download free eBooks at bookboon.com
Use case name Book room.
Scenario Book hotel room for guest.
Trigger Guest requests a room.
Description When a guest requests a room type the receptionist checks the bookings system to see what rooms are available. If a room of the type requested is available a booking is confirmed.
Actors Hotel receptionist.
Related use cases Check room availability.
Stakeholders Hotel management.
Pre-conditions Guest requiring a room.
Post-conditions Room booking confirmed.
Main scenario 1. Ask guest what type of room they require 2. Check bookings system for room availability 3. Confirm room booking with guest
4. Update the bookings system.
Extensions 1a. Room type not available
1a1. Identify alternative available room type 1a2. Return to step 3 in the main success scenario.
Fig 3.7 Extended use case description
Note. There are many use case description templates in use. However, they all include the main information requirements.
A simple use case diagram based on the above scenario is shown below.
Actor Communication association Use case
System boundary
Fig 3.8 A simple use case
Download free eBooks at bookboon.com
Use cases can also interact with other use cases. This is the case when one use case includes the functionality of another use case. It is shown by using the <<include>> relationship.
The following example shows that the use case for checking room availability would be incorporated into the use case for booking a room.
Fig 3.9 A use case with <<include >> association
Note. The use case symbols are shown enclosed within a box to indicate the boundary of the system and the lines linking the actors to use cases are called “communication associations”. Note that some diagrams may include arrow tips pointing in the direction of the communication. An <<extend>> relationship can also be used to show the optional use of a use case, for example a use case “Make payment” might be extended to include a use case for “Credit card payment” and an alternative use case for “Cash payment”.
Download free eBooks at bookboon.com Click on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read more
Use cases should include all related transactions, so in the case of a guest booking into a hotel the associated transactions include room booking, issuing the bill and bill payment.
This situation is shown by the use case diagram below.
Fig 3.10 Hotel booking use case diagram
Exercise 3
Produce a use case description for the following scenario:-
“The hotel housekeeping manager checks the toiletries stock file on a weekly basis to ensure that there are sufficient quantities of soaps, shampoos etc. available. Where necessary, an order is raised to be sent to the supplier. Copies of the orders are kept and used to check the supplier delivery notes and invoices when they are received. Occasionally the suppliers are unable to send the requested toiletries and will suggest alternatives. Once the toiletries have been supplied the stock file is updated.”
Download free eBooks at bookboon.com
Exercise 3 feedback Main success scenario
1. Check stock file weekly
2. If stock quantity < reorder level, raise supplier order 3. File order copy
4. Check order against delivery note/invoice 5. Update stock file with supplies.
Extensions
2a Supplier not able to supply toiletries 2a1 Choose alternative toiletries
2a2 Return to step 3 in the main success scenario.
Download free eBooks at bookboon.com Click on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read moreClick on the ad to read more