Use Case Diagrams
Use Case Diagrams
1
Introduction
Getting started is the most difficulty part of any
new process.
In software modelling, the first thing you need
to do is understand what are you going to
model and ultimately develop.
Creating a highest form details about a
system--use case diagram--is an almost natural
point of origin for the software design.
A use case diagram is an excellent way to
communicate to management, customers, and
other non-development people what a system
will do when it is completed.
2
University Record System (URS)
A University record system should keep information
about its students and academic staff.
Records for all university members are to include their
id number, surname, given name, email, address, date
of birth, and telephone number.
Students and academic staff each have their own unique ID
number: studN (students), acadN (academic employee), where
N is an integer (N>0).
In addition to the attributes mentioned above:
Students will also have a list of subjects they are enrolled in. A
student cannot be enrolled in any more than 10 subjects.
Academic employees will have a salary, and a list of subjects
they teach. An academic can teach no more than 3 subjects.
3
Some Actions Supported by URS
4
Use Case Diagrams
5
Use Case Diagram - URS System
URS
add member
del member
system
user add subject academic
del subject
assg subject
unass subject
enrol subject
student
unenrol subject
6
Use Case Diagrams
A set of ACTORS : roles users can play in
interacting with the system.
An actor is used to represent something that users our
system.
A set of USE CASES: each describes a possible kind
of interaction between an actor and the system.
Uses cases are actions that a user takes on a system
A number of RELATIONSHIPS between these
entities (Actors and Use Cases).
Relationships are simply illustrated with a line
connecting actors to use cases.
7
Use Case Diagrams - Actors
Borrow Reserve
9
Use Case Diagram – Example1
(Library)
library system
borrow
client employee
reserve
Order title
Fine payment
supervisor
A Library System.
10
Use Case Diagram for Student
Assessment Management System
Grade system
Record
grades
Student
View grades
Teacher Distribute
Report cards
Create report
cards
Printing administrator
11
Use Case Vs Scenarios
13
Scenarios
14
Use Case Diagrams - Relationships
Inclusion
Inclusion enables to reuse one use case's steps
inside another use case.
Extension
Allows creating a new use case by adding steps to
existing use cases
Generalization
Allows child use cases to inherit behavior from
parent use cases
15
Use Case – Example (self service
machine)
Buy a product
Self service machine
customer
Collect Money
Collector
Self service machine
Restock
Supplier
16
Use Case – Example (self service machine
– includes relationship)
<<includes>>
Open Machine
Restock
<<includes>>
Open Machine
Collect
<<includes>>
Close Machine
17
Use Case – Example (self service machine
– extends relationship)
<<includes>>
Open Machine
Restock
<<includes>>
Close Machine
<<extends>>
Restock According
to Sales
18
Use Case – Example (self service machine –
generalize relationship): Actor-to-Actor
relationship
generalized actor
Supplier Agent
specialized
actor
Restocker Collector
19
Use Case – Example (self service machine –
generalize relationship): Actor-to-Actor
relationship – example 2
generalized actor
Cook
specialized
actor
<<includes>>
customer Open Machine
Restock
<<includes>>
supplier Close Machine
21
22