Professional Documents
Culture Documents
%
Use Case
Use Case
(
$pecifying the )ehavior of a Use Case
$pecifying the )ehavior of a Use Case
.
&ctors
&ctors
1
Use Cases and &ctors
Use Cases and &ctors
4
'"ample of Use Case Diagram
'"ample of Use Case Diagram
student
registration
updating
grades
output
generating
faculty
5
6elationships bet!een Use Cases
6elationships bet!een Use Cases
1. 7eneralization # use cases that are
1. 7eneralization # use cases that are
specialized versions of other use cases.
specialized versions of other use cases.
%. *nclude # use cases that are included as
%. *nclude # use cases that are included as
parts of other use cases. 'nable to factor
parts of other use cases. 'nable to factor
common behavior.
common behavior.
(. '"tend # use cases that e"tend the behavior
(. '"tend # use cases that e"tend the behavior
of other core use cases. 'nable to factor
of other core use cases. 'nable to factor
variants.
variants.
8
1. 7eneralization
1. 7eneralization
9
registration
graduate
registration
non#graduate
registration
:ore about 7eneralization
:ore about 7eneralization
1;
%. *nclude
%. *nclude
11
:ore about *nclude
:ore about *nclude
1%
(. '"tend
(. '"tend
1(
:ore about '"tend
:ore about '"tend
1.
6elationships bet!een &ctors
6elationships bet!een &ctors
7eneralization.
7eneralization.
student
non#graduate
student
graduate
student
11
6elationships bet!een Use Cases
6elationships bet!een Use Cases
and &ctors
and &ctors
14
'"ample
'"ample
place
phone call
cellular
net!or/
user
receive
phone call
place
conference
call
receive
additional
call
use
scheduler
<<e"tend==
<<e"tend==
Cellular 3elephone
15
Update Items
Bookshop
Worker
Ship Order
Bookshop
Manaer
Update Sta!! "etai#s
$eister "etai#s
%&stomer
'
S(stem )oin
Update %&stomer "etai#s
*dd Items to Shoppin%art
+and#e Order
,,in-#&de..
,,e/tend..
,,in-#&de..
Make Order
,,in-#&de..
& :ore Complicate '"ample
& :ore Complicate '"ample
18
'ach use case may include all or part of the follo!ing 'ach use case may include all or part of the follo!ing
:
:
3itle or 6eference >ame 3itle or 6eference >ame # meaningful name of the UC # meaningful name of the UC
&uthor?Date &uthor?Date # the author and creation date # the author and creation date
:odification?Date :odification?Date # last modification and its date # last modification and its date
urpose urpose # specifies the goal to be achieved # specifies the goal to be achieved
@vervie! @vervie! # short description of the processes # short description of the processes
re Conditions re Conditions # must be true to allo! e"ecution # must be true to allo! e"ecution
ost Conditions ost Conditions # !ill be set !hen completes normally # !ill be set !hen completes normally
>ormal flo! of events >ormal flo! of events # regular flo! of activities # regular flo! of activities
<ernative flo! of events <ernative flo! of events # other flo! of activities # other flo! of activities
'"ceptional flo! of events '"ceptional flo! of events # unusual situations # unusual situations
*mplementation issues *mplementation issues # foreseen implementation problems # foreseen implementation problems
Use Case Description
Use Case Description
19
'"ample# :oney Aithdra!
'"ample# :oney Aithdra!
&uthor+ B) &uthor+ B)
urpose+ 3o !ithdra! some cash from user0s ban/ account urpose+ 3o !ithdra! some cash from user0s ban/ account
@vervie!+ 3he use case starts !hen the customer inserts his credit @vervie!+ 3he use case starts !hen the customer inserts his credit
card into the system. 3he system requests the user *>. 3he system card into the system. 3he system requests the user *>. 3he system
validates the *>. *f the validation succeeded, the customer can choose validates the *>. *f the validation succeeded, the customer can choose
the !ithdra! operation else alternative 1 C validation failure is the !ithdra! operation else alternative 1 C validation failure is
e"ecuted. 3he customer enters the amount of cash to !ithdra!. 3he e"ecuted. 3he customer enters the amount of cash to !ithdra!. 3he
system chec/s the amount of cash in the user account, its credit limit. system chec/s the amount of cash in the user account, its credit limit.
*f the !ithdra! amount in the range bet!een the current amount D *f the !ithdra! amount in the range bet!een the current amount D
credit limit the system dispense the cash and prints a !ithdra! receipt, credit limit the system dispense the cash and prints a !ithdra! receipt,
else alternative % C amount e"ceeded is e"ecuted. else alternative % C amount e"ceeded is e"ecuted.
%;
'"ample# :oney Aithdra! (cont.)
'"ample# :oney Aithdra! (cont.)
re Condition+ re Condition+
C
3he &3: must be in a state ready to accept transactions 3he &3: must be in a state ready to accept transactions
C
3he &3: must have at least some cash on hand that it can 3he &3: must have at least some cash on hand that it can
dispense dispense
C
3he &3: must have enough paper to print a receipt for at least 3he &3: must have enough paper to print a receipt for at least
one transaction one transaction
%1
'"ample# :oney Aithdra! (cont.)
'"ample# :oney Aithdra! (cont.)
Typical Course of events:
&ctor &ctions &ctor &ctions $ystem &ctions $ystem &ctions
1. )egins !hen a Customer arrives at &3: 1. )egins !hen a Customer arrives at &3:
%. Customer inserts a Credit card into &3: %. Customer inserts a Credit card into &3: (. $ystem verifies the customer *D and status (. $ystem verifies the customer *D and status
1. Customer chooses EAithdra!F operation 1. Customer chooses EAithdra!F operation .. $ystem as/s for an operation type .. $ystem as/s for an operation type
5. Customer enters the cash amount 5. Customer enters the cash amount 4. $ystem as/s for the !ithdra! amount 4. $ystem as/s for the !ithdra! amount
8. $ystem chec/s if !ithdra! amount is legal 8. $ystem chec/s if !ithdra! amount is legal
9. $ystem dispenses the cash 9. $ystem dispenses the cash
1;. $ystem deduces the !ithdra! amount from 1;. $ystem deduces the !ithdra! amount from
account account
11. $ystem prints a receipt 11. $ystem prints a receipt
1(. Customer ta/es the cash and the receipt 1(. Customer ta/es the cash and the receipt 1%. $ystem e-ects the cash card 1%. $ystem e-ects the cash card
%%
'"ample# :oney Aithdra! (cont.)
'"ample# :oney Aithdra! (cont.)
%(
'"ample# :oney Aithdra! (cont.)
'"ample# :oney Aithdra! (cont.)
@ne method to identify use cases is actor#based+ @ne method to identify use cases is actor#based+
# # *dentify the actors related to a system or organization. *dentify the actors related to a system or organization.
# 2or each actor, identify the processes they initiate or participate in. # 2or each actor, identify the processes they initiate or participate in.
& second method to identify use cases is event#based+ & second method to identify use cases is event#based+
# *dentify the e"ternal events that a system must respond to. # *dentify the e"ternal events that a system must respond to.
# 6elate the events to actors and use cases. # 6elate the events to actors and use cases.
3he follo!ing questions may be used to help identify the use cases for 3he follo!ing questions may be used to help identify the use cases for
a system+ a system+
#
Ahat are tas/s of each actor G Ahat are tas/s of each actor G
#
Aill any actor create, store, change, remove, or read information in the system G Aill any actor create, store, change, remove, or read information in the system G
#
Ahat use cases !ill create, store, change, remove, or read this information G Ahat use cases !ill create, store, change, remove, or read this information G
#
Aill any actor need to inform the system about sudden, e"ternal changes G Aill any actor need to inform the system about sudden, e"ternal changes G
#
Does any actor need to be informed about certain occurrences in the system G Does any actor need to be informed about certain occurrences in the system G
#
Can all functional requirements be performed by the use cases G Can all functional requirements be performed by the use cases G
%.
:oving on
:oving on