8/18/2019 02UseCase Diagram 4
1/42
Use Case Diagram
© copyright 2001 SNU OOPSLA Lab.
8/18/2019 02UseCase Diagram 4
2/42
Contents - A
!ntro"#ction to U$L
Use Case Diagram
Cass % Ob&ect Diagram
!nteraction Diagrams
State % Acti'ity Diagram
!mpementation Diagrams
8/18/2019 02UseCase Diagram 4
3/42
Contents ( Use Case Diagram
)hat are Use Cases
)hat are Actors
Actor *eationships
Use Case Scenario
Use Case *eationships
Use Case Diagram
8/18/2019 02UseCase Diagram 4
4/42
Use Case $o"eing
Use Cases
Actors
*eationships
8/18/2019 02UseCase Diagram 4
5/42
)hat are Use Cases Peope #se" typica scenarios to hep them
#n"erstan" re+#irements
,hese scenarios ere treate" 'ery inormay (aays "one b#t rarey "oc#mente"
!'ar /acobson raise" the 'isibiity o the #se case
8/18/2019 02UseCase Diagram 4
6/42
)hat are Use Cases
Deposit money
…
…
actor
use case
(complete functionality)
system
8/18/2019 02UseCase Diagram 4
7/42
)hat are Use Cases
Use Case Denition A compete #nctionaity A set o se+#ences o actions a system perorms
that yie" an obser'abe res#t o 'a#e to apartic#ar actor
Actions comm#nicating ith a n#mber o actors perorming cac#ations or insi"e the system
8/18/2019 02UseCase Diagram 4
8/42
)hat are Use Cases
Use Cases A #se case is a typica interaction beteen a #ser
an" a comp#ter system
Use cases "oc#ment the beha'ior o the systemrom the #sers points o 'ie
A #ser might be a person3 another inormationsystem3 a har"are "e'ice3 etc
A #ser is e4terna to the system
8/18/2019 02UseCase Diagram 4
9/42
)hat are Use Cases
,he characteristics o a #se case are 5 A #se case is aays initiate" by an actor A #se case pro'i"es 'a#e to an actor
A #se case is compete
8/18/2019 02UseCase Diagram 4
10/42
)hat are Use Cases
Uses o Use Cases 6ep capt#re system re+#irements 7oo" or panning iterations o "e'eopment
Use# or 'ai"ating the system Use Cases Doc#mentation
A singe #se case represents a tas that is re+#ireo the system
!nc#"e a te4t "escription o each #se case A #se case "iagram is a concise s#mmary o the
te4t "escriptions
8/18/2019 02UseCase Diagram 4
11/42
)hat are Use Cases
84ampe o Use Case
Use Case Naming 8ach #se case has a #ni+#e name Name ,ype
Simpe name Path name
Place Order Simple name
Validate User Sensors::
Caliblate locat
Path name
LoanOffice
Process loan
name
Actor Use Case
8/18/2019 02UseCase Diagram 4
12/42
)hat are Use Cases
!"entiying Use Cases )hich #nctions "oes the actor re+#ire rom
system9
Does the actor nee" to rea"3 create3 "estroy3mo"iy3 or store some in" o inormation in thesystem9
Does the actor ha'e to be notie" abo#t e'ents inthe system
Co#" the actor:s "aiy or be simpie" or ma"emore e;cient thro#gh ne #nctions in the system
8/18/2019 02UseCase Diagram 4
13/42
Contents ( Use Case Diagram
)hat are Use Cases
)hat are Actors
Actor *eationships
Use Case Scenario
Use Case *eationships
Use Case Diagram
8/18/2019 02UseCase Diagram 4
14/42
)hat are Actors
Actors An actor in a #se case "iagram represents a role
that someone may pay3 not an in"i'i"#a #ser o
the system ,he same person can be "i
8/18/2019 02UseCase Diagram 4
15/42
)hat are Actors
!"entiying actors Use# +#estions
Who will use the main functionality of the system(primaryactors)?
Who will need support from the system to do their dailytasks?
Who will need to maintain, administrate, and keep thesystem working (secondary actors)?
Which hardware devices does the system need to handle? With which other systems does the system need to interact
Who or what has an interest in the results (the value) thatthe system produces?
8/18/2019 02UseCase Diagram 4
16/42
)hat are Actors
!"entiying actors 7enerate a ist o actors rst3 an" then try to or
o#t the #se cases or each actor
A #ser3 ho pays se'era "i
8/18/2019 02UseCase Diagram 4
17/42
)hat are Actors
Actors representation Name Description
actor 가 무엇을 하고 누구인지를 표현한다
actor 가 왜 필요한가를 표현한다 actor 가 시스템에서 흥미로운 부분은 무엇인가를 표현한다
84ampe Actors in Uni'ersity !normation System
8nro st#"ents in co#rses O#tp#t seminar enroment ists *emo'e st#"ents rom co#rses Pro"#ce st#"ent transcripts
8/18/2019 02UseCase Diagram 4
18/42
)hat are Actors
84ampe=Cont.> Actors in Uni'ersity !normation System
!np#t $ars
8nro in Co#rse
Distrib#te ,ranscripts
Student
Professor
Registrar
8/18/2019 02UseCase Diagram 4
19/42
Contents ( Use Case Diagram
)hat are Use Cases
)hat are Actors
Actor *eationships
Use Case Scenario
Use Case *eationships
Use Case Diagram
8/18/2019 02UseCase Diagram 4
20/42
Actor *eationships
EstablishCredit
Place
Order
Salesperson
Supervisor
1 *
1 *
*eationships beteen actors 7enerai?ation
general superclass actor
8/18/2019 02UseCase Diagram 4
21/42
Contents ( Use Case Diagram
)hat are Use Cases
)hat are Actors
Actor *eationships
Use Case Scenario
Use Case *eationships
Use Case Diagram
8/18/2019 02UseCase Diagram 4
22/42
Use Case Scenario
Use Case Scenario Use case scenario is a specic e4ampe o a #se case
A scenario is an instance o a #se case3 as an ob&ect is an
instance o a cass
A #se case "escribes a set o reate" scenarios @or each #se case5
)hat are the possibe scenarios9 )hat are the r#es or appying a partic#ar scenario9
,o capt#re this inormation3 a sotare engineer o#" #se
te4t#a "escription o the #se case
8/18/2019 02UseCase Diagram 4
23/42
Use Case Scenario
Use Case Scenario 84ampe Uni'ersity !normation System
8nro st#"ents in co#rsesB scenario
A st#"ent ants to enro in a co#rse b#t they are missina prere+#isite
A st#"ent ants to enro in a co#rse b#t the co#rse iso'er-booe" or the term
A st#"ent ants to enro in a co#rse3 they ha'e theprere+#isites an" there is sti room et
8/18/2019 02UseCase Diagram 4
24/42
Contents ( Use Case Diagram
)hat are Use Cases
)hat are Actors
Actor *eationships
Use Case Scenario Use Case *eationships
Use Case Diagram
8/18/2019 02UseCase Diagram 4
25/42
Use Case *eationship
Depen"ency an" !nheritance A simpe ine beteen an actor an" a #se case means that
that actor is e4pecte" to perorm that #se case= Association
A ine ith arro hea" rom an actor to an actor "enes a
specia in" o actor 5 e.g3 st#"ent3 gra"3#n"ergra"= 7enerai?ation >
A ine ith arro hea" rom a #se case to a #se case isabee"5 e4ten"s 5 ,he bottom #se case is a specia ay to "o the
more genera tas
#ses 5 ,he bottom #se case is a arger tas that inc#"esthe top #se case as one step
8/18/2019 02UseCase Diagram 4
26/42
Use Case *eationship
*eationship beteen Use Cases ,he stereotype #ses
,he #ses stereotype is hen yo# can impement part o onor more o yo#r #se cases by #sing a component
Chec or reser'ation is a #se case =s#b-scenario> that is #se" b
both 84ten" oan an" Eorro copy o boo
So#rce #se cases =84ten" oan an" Eorro copy o boo> mae#se o the target #se case3 Chec or reser'ation= ha'e common
beha'ior >
8/18/2019 02UseCase Diagram 4
27/42
Use Case *eationship
*eationship beteen Use Cases Pitas o #sing the #ses stereotype are5
!t may ea" to top-"on #nctiona "ecomposition $aer it har"er or the c#stomer to #n"erstan" #se case
"iagrams Consi"er #sing a #ses reationship beteen
#se cases to sho ho the system can #se a pre-e4isting componen to sho common #nctionaity beteen #se cases
to "oc#ment the act that the pro&ect has "e'eope" a nere#sabe component
8/18/2019 02UseCase Diagram 4
28/42
Use Case *eationship
*eationship beteen Use Cases ,he stereotype e4ten"s
A #ses reationship 5 one #se case aays inc#"es the beha'ior
o another
A e4ten"s reationship 5 one #se case con"itionay inc#"es the
beha'ior o another An e4ten"s reationship rom #se case A to #se case E in"icates
that an instance o #se case E may inc#"e the beha'ior
specie" by #se case A An e4ten"ing #se case "enes e4ceptiona beha'ior or the #se
case it e4ten"s
8/18/2019 02UseCase Diagram 4
29/42
Use Case *eationship
*eationship beteen Use Cases ,he stereotype e4ten"s
84ten"s is #se" to separate o#t a specia case
,he centra case is Eorro copy o boo ,he ess centra case is *e#se oan
,he con"ition #n"er hich the e4ception appies is Ftoomany boosF
8/18/2019 02UseCase Diagram 4
30/42
additional requests :
Order Product
SupplyArrange
«include»«include»«include»
RequestCatalog
«extend»Extension points
PaymentCustomer Data
after creation of the order
Place Order
1 * the salesperson asks for the catalog
Use Case *eationship
8/18/2019 02UseCase Diagram 4
31/42
Contents ( Use Case Diagram
)hat are Use Cases
)hat are Actors
Actor *eationships
Use Case Scenario Use Case *eationships
Use Case Diagram
8/18/2019 02UseCase Diagram 4
32/42
Use Case Diagram
Use Case Diagram Sho e4pecte" actors an" #se cases Sho hich actors "o hich #se cases
Sho "epen"ency an" inheritance among #secases
Place phone
call
Receie
phone call
Use
sched!ler
Place
conference call
Receie
additional call
""e#tend$$
""e#tend$$
Use Case
System bo!ndaryUser
Cell!lar
net%or&
'ctor
'ssociation
! ()#tend*
8/18/2019 02UseCase Diagram 4
33/42
Use Case Modeling: Core8ementsConstruct Description Syntax
use case A sequence of actions, includingvariants, that a system (or otherentity) can perform, interacting withactors of the system
actor A coherent set of roles that usersof use cases play when interactingwith these use cases
systemboundary
!epresents the "oundary "etweenthe physical system and the actors
who interact with the physicalsystem
# s e $ a s e % a m e
A c t o r % a m e
8/18/2019 02UseCase Diagram 4
34/42
Construct Description Syntax
association &he participation of an actor in a use
case ie, instance of an actor andinstances of a use case communicate
with each other
extend A relationship from an extension use
case to a base use case, specifyinghow the "ehavior for the extension
use case can "e inserted into the
"ehavior defined for the "ase usecase
generalization A taxonomic relationship "etween a
more general use case and a morespecific use case
Use Case Modeling: Core*eationships
''extend
8/18/2019 02UseCase Diagram 4
35/42
Construct Description Syntax
include An relationship from a base use caseto an inclusion use case, specifyinghow the "ehavior for the inclusion usecase is inserted into the "ehavior
defined for the "ase use case
Use Case Modeling: Core*eationships =cont:">
''include
8/18/2019 02UseCase Diagram 4
36/42
$o"e #ser re+#irements ith #se cases. $o"e test scenarios ith #se cases. ! yo# are #sing a #se-case "ri'en metho"
start ith #se cases an" "eri'e yo#r str#ct#ra an" beha'ioramo"es rom it.
! yo# are not #sing a #se-case "ri'en metho" mae s#re that yo#r #se cases are consistent ith yo#r str#ct#ra
an" beha'iora mo"es.
)hen to mo"e #se cases
8/18/2019 02UseCase Diagram 4
37/42
Use Case $o"eing ,ips
$ae s#re that each #se case "escribes a signicant ch#n osystem #sage that is #n"erstan"abe by both "omain e4perts anprogrammers
)hen "ening #se cases in te4t3 #se no#ns an" 'erbs acc#rateyan" consistenty to hep "eri'e ob&ects an" messages orinteraction "iagrams =see Lect#re 2>
@actor o#t common #sages that are re+#ire" by m#tipe #se cas ! the #sage is re+#ire" #se inc#"e ! the base #se case is compete an" the #sage may be optiona3 consi"er #
e4ten"
A #se case "iagram sho#" contain ony #se cases at the same e'e o abstraction
inc#"e ony actors ho are re+#ire" Large n#mbers o #se cases sho#" be organi?e" into pacages
8/18/2019 02UseCase Diagram 4
38/42
Describing Use Cases
,e4t Description 84terna beha'ior o the system is important ,he te4t "escription sho#" inc#"e 5
Ob&ecti'e or the #se case 5 #se cases are goa-oriente" 6o the #se case is initiate" ,he Go o messages beteen actors an" the #se case
Aternati'e Go in the #se case 5 con"ition or e4ception
6o the #se case nishes ith a 'a#e to the actor
8/18/2019 02UseCase Diagram 4
39/42
O n l i n e R S y s t e m
! o c a t eE m p l o y e e s
" p d a t e
E m p l o y e eP r o # i l e
" p d a t e $ e n e # i t s
A c c e s s % r a v e l
S y s t e m
A c c e s s P a yR e c o r d s
E m p l o y e e
& a n a g e r
e a l t h c a r e P l a n S y s t e m
) i f c u r r e n t * o n t h + , c t -
) r e a d , n l y -
' n s u r a n c e P l a n S y s t e m
84ampe5 Onine 6* System
8/18/2019 02UseCase Diagram 4
40/42
" p d a t e & e d i c a lP l a n
" p d a t e D e n t a lP l a n
" p d a t e $ e n e # i t s
( ( ( ( ( ( ( ( ( ( ( ( ( (E x t e n s i o n p o i n t s
b e n e f i t o p t i o n s :
a f t e r r e q u i r e d e n r o l l m e n t s
" p d a t e' n s u r a n c e P l a n
E m p l o y e e
) ) i n c l u d e * * ) ) i n c l u d e * * ) ) i n c l u d e * *
E l e c tR e i m b u r s e m e n t
# o r e a l t h c a r e
E l e c t S t o c +
P u r c h a s e
) ) e x t e n d * *
e m p l o y e e r e q u e s t s
s t o c k p u r c h a s e o p t i o n
) ) e x t e n d * *
e m p l o y e e r e q u e s t s
r e i m " u r s e m e n t o p t i o n
e x t e n s i o n
c o n d i t i o n
e x t e n s i o n p o i n t
n a m e a n d
l o c a t i o n
Onine 6* System5 Use Case*eationships
8/18/2019 02UseCase Diagram 4
41/42
84ampe5 $ae Appointment
8/18/2019 02UseCase Diagram 4
42/42
84ampe5 *ationa *ose Use Case ,oo