Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2
Fall 2002 SJSU – CmpE M.E. Fayad L09-S2 Use Case Modeling
Lesson Objectives
3
Fall 2002 SJSU – CmpE M.E. Fayad L09-S3 Use Case Modeling
What is use case modeling?
4
Fall 2002 SJSU – CmpE M.E. Fayad L09-S4 Use Case Modeling
Use Case Modeling: Core Elements
Construct Description Syntax
use case A sequence of actions, including
variants, that a system (or other
entity) can perform, interacting with U seC aseN am e
7
Fall 2002 SJSU – CmpE M.E. Fayad L09-S7 Use Case Modeling
Use Case Diagram Tour
8
Fall 2002 SJSU – CmpE M.E. Fayad L09-S8 Use Case Modeling
Use Case Model
Telephone Catalog
Check
status
Place Salesperson
order
F ill o r d e r s
Customer Shipping Clerk
Establish
credit
9
Supervisor
Fig. 3-44, UML Notation Guide
Fall 2002 SJSU – CmpE M.E. Fayad L09-S9 Use Case Modeling
Use Case Diagram: Relationships
Supply Order
Customer Data Product Arrange
Payment
Place Order
Request
Catalog
1 * Place
Order
Salesperson
Establish
1 *
Supervisor
Credit
11
Fig. 3-46, UML Notation Guide
Fall 2002 SJSU – CmpE M.E. Fayad L09-S11 Use Case Modeling
Use Case Description: Change Flight
Actors: traveler, client account db, airline reservation system
Preconditions:
…
12
System displays transaction summary.
Alternative courses
Fall 2002 SJSU – CmpE M.E. Fayad L09-S12 Use Case Modeling
When to model use cases
13
Fall 2002 SJSU – CmpE M.E. Fayad L09-S13 Use Case Modeling
Use Case Modeling Tips
Make sure that each use case describes a significant chunk of
system usage that is understandable by both domain experts and
programmers
When defining use cases in text, use nouns and verbs accurately
and consistently to help derive objects and messages for
interaction diagrams
Factor out common usages that are required by multiple use cases
– If the usage is required use <<include>>
– If the base use case is complete and the usage may be optional,
consider use <<extend>>
A use case diagram should
– contain only use cases at the same level of abstraction
– include only actors who are required
Large numbers of use cases should be organized into packages
Fall 2002 SJSU – CmpE M.E. Fayad L09-S14 Use Case Modeling
Sample Problem Statement: Library System
15
*Example from: “Using UML”, by: Pooley and Stevens
Fall 2002 SJSU – CmpE M.E. Fayad L09-S15 Use Case Modeling
First Step!
17
Fall 2002 SJSU – CmpE M.E. Fayad L09-S17 Use Case Modeling
The Use Case Template
18
Fall 2002 SJSU – CmpE M.E. Fayad L09-S18 Use Case Modeling
Documenting Use Cases
19
Copyright © 1997 by Rational Software Corporation
Fall 2002 SJSU – CmpE M.E. Fayad L09-S19 Use Case Modeling
Actors
An actor is someone or something that must interact with the
system under development
BookBorrower
Browser
Librarian
JournalBorrower
Fall 2002 SJSU – CmpE M.E. Fayad L09-S20 Use Case Modeling
Use Cases
Actors are examined to determine their needs
– BookBorrower
• Checkout and return books
– Browser
• locate and peruse items of interest
– Librarian
• maintain order and accountablility
– JournalBorrower
• checkout and return journals
Fall 2002 SJSU – CmpE M.E. Fayad L09-S21 Use Case Modeling
Use Case Description
The usual course through the system when actor is using the
system is called the basic course. Other courses would be
modeled as extending Use Cases.
An example of a basic course would be:
– Borrow copy of book A BookBorrower presents a book. The
system checks that the potential borrower is a member of the
library, and that s/he does not already have the maximum
permitted number of books on loan. This maximum is six unless
the member is a staff member, in which case it is 12. If both
checks succeed, the system records that this library member has
this copy of the book on loan.
**Example from: “Using UML”, by: Pooley and Stevens
22
Fall 2002 SJSU – CmpE M.E. Fayad L09-S22 Use Case Modeling
Use Case Diagram for the first iteration
23
*Example from: “Using UML”, by: Pooley and Stevens
Fall 2002 SJSU – CmpE M.E. Fayad L09-S23 Use Case Modeling
What Requirements would an ideal system satisfy?
Fall 2002 SJSU – CmpE M.E. Fayad L09-S24 Use Case Modeling
What Requirements would an ideal system satisfy?
26
*Example from: “Using UML”, by: Pooley and Stevens
Fall 2002 SJSU – CmpE M.E. Fayad L09-S26 Use Case Modeling
Example II: University Registration
Fall 2002 SJSU – CmpE M.E. Fayad L09-S27 Use Case Modeling
Actors
Registrar
Professor
Student
Billing System
28
Copyright © 1997 by Rational Software Corporation
Fall 2002 SJSU – CmpE M.E. Fayad L09-S28 Use Case Modeling
Use Cases
Actors are examined to determine their needs
– Registrar
• maintain the curriculum
– Professor
• request roster
– Student
• maintain schedule
– Billing System
• receive billing information from registration
Student Professor
Maintain Schedule
Registrar
<<uses>>
Register for courses
<<uses>>
Logon validation
Maintain curriculum
33
Fall 2002 SJSU – CmpE M.E. Fayad L09-S33 Use Case Modeling
Cautions
34
Fall 2002 SJSU – CmpE M.E. Fayad L09-S34 Use Case Modeling
Acknowledgements
Fall 2002 SJSU – CmpE M.E. Fayad L09-S35 Use Case Modeling
Sample Use Case from Philips Project (1)
36
Fall 2002 SJSU – CmpE M.E. Fayad L09-S36 Use Case Modeling
Sample Use Case from Philips Project (2)
37
Fall 2002 SJSU – CmpE M.E. Fayad L09-S37 Use Case Modeling
Sample Use Case from Philips Project (3)
38
Fall 2002 SJSU – CmpE M.E. Fayad L09-S38 Use Case Modeling
Sample Use Case from Philips Project (4)
Description of the Use Case:
1. The Registrar enters the information about a person into the IDSession.
2. The IDSession has security clear the request.
3. The IDSession has the PersonIdentifier search for candidates.
4. The Person-Identifier determines that no candidates fit the criteria.
5. The Person-Identifier gives this information to the system.
6. The informs the Registrar that no candidates exist.
7. System asks the Registrar if the person should be added as new.
8. Registrar tells System to add new person.
9. System sends traits to ID-Manager.
10. ID-Manager creates a new profile.
39
Fall 2002 SJSU – CmpE M.E. Fayad L09-S39 Use Case Modeling
Sample Use Case from Philips Project (5)
40
Fall 2002 SJSU – CmpE M.E. Fayad L09-S40 Use Case Modeling
Sample Use Case from Philips Project (6)
41
Fall 2002 SJSU – CmpE M.E. Fayad L09-S41 Use Case Modeling
Sample Use Case from Philips Project (7)
42
Fall 2002 SJSU – CmpE M.E. Fayad L09-S42 Use Case Modeling
Bibliography and Suggested Reading
“Object-Oriented Software Engineering: A use Case Driven Approach”, by Ivar
Jacobsen
“Use Case Modeling: Capturing User Requirements” by Edward Kenworthy (
http://www.zoo.co.uk/~z0001039/PracGuides/pg_use_cases.htm)
“Structuring Use Cases With Goals” by Alistair Cockburn
(http://members.aol.com/acockburn/papers/usecases.htm)
“Use Cases Fundamentals” by Alistair Cockburn
(http://members.aol.com/acockburn/papers/AltIntro.htm)
“OOSC2: The Use Case Principle” by Bertrand Meyer (
http://www.elj.com/elj/v1/n2/bm/use-cases/ )
“The Roles of Use Cases in Analysis” by Daniel A. Rawsthorne, PhD
(http://www.pols.co.uk/usecasezone/UseCaseConcepts.html )
“The Misuse of Use Cases” By Dr. Timothy Korson
(http://www.software-architects.com/publications/korson/Korson9803om.htm )
“Constructing Useful Use Cases” By Dr. Timothy Korson
(http://www.korson-mcgregor.com/publications/korson/usecase3/index.html )
Fall 2002 SJSU – CmpE M.E. Fayad L09-S43 Use Case Modeling
Discussion Questions
• What are the use case modeling good, bad, and ugly?
• Define: Actor, role, and use case
• What are the differences between use cases and
scenarios?
• What are the differences between use case and a
process?
44
Fall 2002 SJSU – CmpE M.E. Fayad L09-S44 Use Case Modeling
Questions for the Next Lecture
What is a problem?
45
Fall 2002 SJSU – CmpE M.E. Fayad L09-S45 Use Case Modeling
Tasks for Next Lecture
46
Fall 2002 SJSU – CmpE M.E. Fayad L09-S46 Use Case Modeling