1 BTEC HNC Systems Support Castle College 2007/8 Systems Analysis Lecture 8 UML Use Case Modelling
1BTEC HNC Systems Support Castle College 2007/8
Systems Analysis
Lecture 8
UML
Use Case Modelling
2BTEC HNC Systems Support Castle College 2007/8
Lecture Objectives
At the end of this lecture you should be able to:
• Explain what UML is
• Understand Use Case Modelling and identify the components
• Draw a Use Case Model
3BTEC HNC Systems Support Castle College 2007/8
System Modelling• Producing a Logical View of the
System means:
• Producing graphical models which use non-technical language
• Representing the system at various stages of design/development
• Charting business processes, requirements and interactions
• Why?
4BTEC HNC Systems Support Castle College 2007/8
UML
• Unified Modelling Language
• Developed by Grandy Booch, Jim Rumbaugh and Ivar Jacobon at Rational Software
• Thought Shower:What is Unified Modelling Language and what is it used for? (p.t.o)
5BTEC HNC Systems Support Castle College 2007/8
Some facts to help you• UML is just a syntax. It says nothing about
how to create a model
• UML is well documented byt little understood
• UML specifies 8 different diagrams. Not all are used in practise
• A use case diagram shows the functionality of the system from the ‘outside in’
• Class diagrams show the static structure of the system
Activity Time!
6BTEC HNC Systems Support Castle College 2007/8
UML Benefits
• Uses Object Oriented design concepts
• Is a popular method of visualising and documenting the software system
• Is independent of any specific programming language
7BTEC HNC Systems Support Castle College 2007/8
UML Benefits (cont.)
• Provides graphical tools, for example Use Case models
• Can represent the information systems from Users’ point of view
• Relate to Business standpoint
8BTEC HNC Systems Support Castle College 2007/8
Use case Diagrams
• One of the defined UML diagrams
• A Use Case Diagram visually represents the interaction between Users and the Information System
• During requirements modelling analysts and user together model the system functions
• Use Case diagrams can be drawn freehand, or using a Case Tool
9BTEC HNC Systems Support Castle College 2007/8
Use Case Diagram
In this diagram the Actor is a customer and the Use Case is a PIN number validation performed by the system
Customer
ATM System
Validate PIN
10BTEC HNC Systems Support Castle College 2007/8
Use Case Diagram (cont.)• The Use Case is the function that
the Actor (user of the system) wants the system to perform
• One Use Case is
– One complete use of the system from start to finish
– Performed by the System
• Represented: ellipse with a written name of the function
11BTEC HNC Systems Support Castle College 2007/8
Use Case Diagram (cont.)
• The Actor is:
– A person or system that directly interacts with the new system
– Represented by a stick figure
– External to the system – at the system interface
– The line joining the Actor and the Use Case is called an Association
12BTEC HNC Systems Support Castle College 2007/8
Use Case Diagram (cont.)• Stereotypes:
– Includes / Uses:One Use Case includes (uses the services of) another Use Case
– Extends: A Use Case that extends functionality
• There is a System Boundary which is illustrated by the square box in which the activities of the system take place
13BTEC HNC Systems Support Castle College 2007/8
Use Case Diagram (2)
Customer
ATM System
Get Balance
Validate PIN
<<Includes>>
How many use cases on Diagram? Name them
14BTEC HNC Systems Support Castle College 2007/8
Use Case Documentation
• It is always necessary to document diagrams in the modelling process
• Because:
– Analysts and designers work as a team (with each other and with Users, Managers, Testers, etc)
– A model alone can be subject to interpretation
15BTEC HNC Systems Support Castle College 2007/8
Use Case Descriptor
Name of Use Case: Validate PIN
Actor: Customer
Description: Verify bank card (including type) and validate PIN number entered by the actor
Successful completion: 1. User inserts bank card2. System Verifies bank card checks type and prompts user for PIN number3. User enters PIN4. System validates PIN and presents options menu to user5a. User cancels transaction and retrieves bank card
or5b. User selects another transaction
Alternative: 1. User inserts bank card2. System Verifies bank card checks type and prompts user for PIN number3. User enters PIN4. System validates PIN and finds it incorrect; system prompts user to re-enter PIN (Repeat
twice)5. User re-enters PIN6. System validates PIN and finds it incorrect (after 3rd attempt), retains card and informs user
Pre-conditions: ATM is on and functional
Post-conditions: PIN number entered has been validated as correct for the card used
Assumptions: None
16BTEC HNC Systems Support Castle College 2007/8
Use Case functions• Successful completion: the activities that
make up the functions of the Use Case
• Notice that the three activities consist of an Input, a Process and an Output
• Use the format:
– The user…
– The system…
– The user…
– The system…
Ensures a cleaner design
17BTEC HNC Systems Support Castle College 2007/8
Events Table: hotel booking
• Event: Customer makes booking
• Trigger: Customer Enquiry
• Source: CustomerActor: Hotel Clerk
• Activity (Use Case): Create new booking
• Response: Room booking confirmation
• Destination: Hotel Clerk and Customer
18BTEC HNC Systems Support Castle College 2007/8
Events tables to Use Case diagrams
We can use the Events table to define the elements of a Use Case model
Question: How does this work?
Answer : Our Events table has given us a Use Case -Create new booking
19BTEC HNC Systems Support Castle College 2007/8
Recap on Use Case model elements
The symbols we can use are as follows:
Actor
Association
Use CaseUse Case label
<<includes>>
20BTEC HNC Systems Support Castle College 2007/8
Actors and Use Cases
Our Event table tells there are 2 Actors or ‘Inter-actors’ involved with the system for the first event
Only the Booking Clerk interacts directly with the system
1. The Booking Clerk
2. The customer (who provides the trigger and necessary input information)
21BTEC HNC Systems Support Castle College 2007/8
Use Case model of the event
Remember this is just a fragment!
Hotel System
Create New Booking
Clerk
22BTEC HNC Systems Support Castle College 2007/8
Over to you…
• It is now your turn to complete the Hotel occurrences example
• Complete the table, and then translate it into a Use Case diagram
• Remember that practice makes perfect
23BTEC HNC Systems Support Castle College 2007/8
Answers
1. Customer contacts the hotel for a free room
2. Clerk checks room availability
3. Customer gives name and address
4. Customer pays deposit
5. Clerk updates system to show room booked
6. Customer rings to order flowers
7. Customer turns up
8. Clerk find room number and gives key
9. Clerk records room as occupied
10. Customer leaves
11. Bill calculated
12. Customer pays bill
13. Clerk records room empty and customer paid.
Customer Makes Booking
Customer Orders service
Customer Checks in
Customer Checks out
24BTEC HNC Systems Support Castle College 2007/8
Events & Use Cases Practise
Could you also construct an events table and Use Case diagram from this example?
25BTEC HNC Systems Support Castle College 2007/8
Summary
You should now be able to:
• Explain what UML is
• Understand Use Case Modelling and identify the components
• Draw a Use Case Model
26BTEC HNC Systems Support Castle College 2007/8
References• Systems Analysis & Design Shelley
Cashman and Rosenblat 6th Ed. Thomson (2006)
• Eva and Skidmore (2004). Introducing Systems Development. Palgrave Macmillan
• Satzinger JW, Jackson RB and Burd SD (2004). Systems Analysis and Design in a Changing World. 3rd edition. Thomson