Descriptive slides for the Collaboration Diagrams in UML
Size: 4.06 MB
Language: en
Added: Apr 26, 2015
Slides: 43 pages
Slide Content
Duration: 3 Hrs
1
RamakantSoni
Assistant Professor
Dept. of Computer Science
B K Birla Institute of Engineering & Technology, Pilani,
India
Ramakant Soni @ BKBIET Pilani
Usecasediagramsareusedtovisualize,
specify,construct,anddocument the
(intended)behaviorofthesystem,during
requirementscaptureandanalysis.
2
Provideawayfordevelopers,domainexperts
andend-userstoCommunicate.
Serveasbasisfortesting.
Usecasediagramscontainusecases,actors,
andtheirrelationships.
Ramakant Soni @ BKBIET Pilani
Usecasesspecifydesiredbehavior.
Ausecaseisadescriptionofasetof
name
3
Ausecaseisadescriptionofasetof
sequencesofactions,includingvariants,
asystemperformstoyieldanobservable
resultofvaluetoanactor.
Eachsequencerepresentaninteraction
ofactorswiththesystem.
Ramakant Soni @ BKBIET Pilani
Anactorrepresentsasetofrolesthatusers
ofusecaseplaywheninteractingwith
theseusecases.
Actorscanbehumanorautomated
name
5
Actorscanbehumanorautomated
systems.
Actorsareentitieswhichrequirehelpfrom
thesystemtoperformtheirtaskorare
neededtoexecutethesystem’sfunctions.
Actorsarenotpartofthesystem.
Ramakant Soni @ BKBIET Pilani
From the perspective of a given actor, a
use case does something that is of value
to the actor, such as calculate a result or
change the state of an object.
6
change the state of an object.
The Actors define the environments in
which the system lives
Ramakant Soni @ BKBIET Pilani
The child use case inherits the
behavior and meaning of the
parent use case.
parent
9
parent use case.
The child may add to or
override the behavior of its parent.
child
Ramakant Soni @ BKBIET Pilani
Thebaseusecaseexplicitlyincorporates
thebehaviorofanotherusecaseata
locationspecifiedinthebase.
base included
<<include>>
11
locationspecifiedinthebase.
Theincludedusecaseneverstands
alone.Itonlyoccursasapartofsome
largerbasethatincludesit.
Ramakant Soni @ BKBIET Pilani
Enables to avoid describing the same
flow of events several times by putting
the common behavior in a use case of
its own.
12
its own.
updating
grades
output
generating
verifying
student id
<<include>>
<<include>>
Ramakant Soni @ BKBIET Pilani
Ramakant Soni @ BKBIET Pilani 13
Thebaseusecaseimplicitlyincorporates
thebehaviorofanotherusecaseat
certainpointscalledextensionpoints.
base extending
<<extend>>
14
certainpointscalledextensionpoints.
Thebaseusecasemaystandalone,but
undercertainconditionsitsbehavior
maybeextendedbythebehaviorof
anotherusecase.
Ramakant Soni @ BKBIET Pilani
Enables to model optional behavior or
branching under conditions.
15
Exam copy
request
Exam-grade
appeal
<<extend>>
Ramakant Soni @ BKBIET Pilani
Actorsmaybeconnectedtousecases
byassociations,indicatingthattheactor
andtheusecasecommunicate with
oneanotherusingmessages.
18
oneanotherusingmessages.
updating
grades
faculty
Ramakant Soni @ BKBIET Pilani
place
phone call
cellular
place
conference
call
<<extend>>
19
cellular
network
user
receive
phone call
receive
additional
call
use
scheduler
<<extend>>
Cellular Telephone
Ramakant Soni @ BKBIET Pilani
20Ramakant Soni @ BKBIET Pilani
Each use case may include all or part of the following:
Title or Reference Name-meaningful name of the UC
Author/Date -the author and creation date
Modification/Date -last modification and its date
Purpose -specifies the goal to be achieved
Overview -short description of the processes
21
Overview -short description of the processes
Cross References -requirements references
Actors -agents participating
Pre Conditions -must be true to allow execution
Post Conditions -will be set when completes normally
Normal flow of events-regular flow of activities
Alternative flow of events -other flow of activities
Exceptional flow of events -unusual situations
Implementation issues-foreseen implementation problems
Use Case: Withdraw Money
Author: RS
Date: 19-Nov-2014
Purpose: To withdraw some cash from user’s bank account
Overview:Theusecasestartswhenthecustomerinsertshis
22
Overview:Theusecasestartswhenthecustomerinsertshis
creditcardintothesystem.ThesystemrequeststheuserPIN.The
systemvalidatesthePIN.Ifthevalidationsucceeded,the
customercanchoosethewithdrawoperationelsealternative1
–validationfailureisexecuted.Thecustomerenterstheamount
ofcashtowithdraw.Thesystemcheckstheamountofcashin
theuseraccount,itscreditlimit.Ifthewithdrawamountinthe
rangebetweenthecurrentamount+creditlimitthesystem
dispensethecashandprintsawithdrawreceipt,elsealternative
2–amountexceededisexecuted.
Cross References: R1.1, R1.2, R7
Ramakant Soni @ BKBIET Pilani
Actors: Customer
Pre Condition:
›The ATM must be in a state ready to accept transactions
›The ATM must have at least some cash on hand that it can
dispense
›The ATM must have enough paper to print a receipt for at
23
›The ATM must have enough paper to print a receipt for at
least one transaction
Post Condition:
›The current amount of cash in the user account is the
amount before the withdraw minus the withdraw amount
›A receipt was printed on the withdraw amount
›The withdraw transaction was audit in the System log file
Ramakant Soni @ BKBIET Pilani
Typical Course of events:
Actor Actions System Actions
1. Begins when a Customer arrives at ATM
2. Customer inserts a Credit card into ATM3. System verifies the customer ID and status
5. Customer chooses “Withdraw” operation4. System asks for an operation type
24
5. Customer chooses “Withdraw” operation4. System asks for an operation type
7. Customer enters the cash amount 6. System asks for the withdraw amount
8. System checks if withdraw amount is legal
9. System dispenses the cash
10. System deduces the withdraw amount from
account
11. System prints a receipt
13. Customer takes the cash and the receipt12. System ejects the cash card
RamakantSoni@ BKBIET Pilani
Alternative flow of events:
›Step 3:Customer authorization failed. Display an
error message, cancel the transaction and eject the
card.
›Step 8:Customer has insufficient funds in its account.
25
›Step 8:Customer has insufficient funds in its account.
Display an error message, and go to step 6.
›Step 8:Customer exceeds its legal amount. Display
an error message, and go to step 6.
Exceptional flow of events:
›Power failure in the process of the transaction before
step 9, cancel the transaction and eject the card
Ramakant Soni @ BKBIET Pilani
One method to identify use cases is actor-based:
-Identify the actors related to a system or organization.
-For each actor,identify the processes they initiate or participate in.
A second method to identify use cases is event-based:
-Identify the external events that a system must respond to.
-Relate the events to actors and use cases.
The following questions may be used to help identify the use
26
The following questions may be used to help identify the use
cases for a system:
-What are tasks of each actor ?
-Will any actor create, store, change, remove, or read information in the
system ?
-What use cases will create, store, change, remove, or read this
information ?
-Will any actor need to inform the system about sudden, external changes
?
-Does any actor need to be informed about certain occurrences in the
system ?
-Can all functional requirements be performed by the use cases ?
Ramakant Soni @ BKBIET Pilani
Controller
Water Pump
Hot Water
Water Valve
Home
Temp Sensor
*
29
Fuel Valve
90
80
70
60
50
On
Off
Burner
Fuel
Temp Sensor
Control Panel
Ramakant Soni @ BKBIET Pilani
Power Up
Home Heating
Home Owner
MH
Power Down
Change Temp.
30Ramakant Soni @ BKBIET Pilani
Use case: Power Up
Actors: Home Owner (initiator)
Type: Primary and essential
Description: The Home Owner turns the power on. Each room is temperature
checked. If a room is below the thedesired temperature the valve for
the room is opened, the water pump started. If the water temp falls the room is opened, the water pump started. If the water temp falls
below threshold, the fuel valve is opened, and the burner ignited. If the
temperature in all rooms is above the desired temperature, no actions
are taken.
Cross Ref.: Requirements XX, YY, and ZZ
Use-Cases: None
31Ramakant Soni @ BKBIET Pilani
Power Up
Power Down
Home Heating
Adjust Temp
Temp. High
«includes»
«includes»
Home Owner
MH
Change Temp.
Adjust Temp
Temp. Low
«includes»
«includes»
32Ramakant Soni @ BKBIET Pilani
Use case : Power Up
Actors : Home Owner (initiator)
Type : Primary and essential
Description : The Home Owner turns the power on.
Perform Adjust Temp. If the temperature in all rooms is
above the desired temperature, no actions are taken.
*
above the desired temperature, no actions are taken.
Cross Ref : Requirements XX, YY, and ZZ
Use-Cases : Perform Adjust Temp
33Ramakant Soni @ BKBIET Pilani
Ramakant Soni @ BKBIET Pilani 34
Credits : Scott W. Amber
Ramakant Soni @ BKBIET Pilani 35
Credits : Scott W. Amber
Example: Online shopping.
Ramakant Soni @ BKBIET Pilani 36
1.Place Your Primary Actor(S) In The Top-Left Corner Of The Diagram
2.Draw Actors To The Outside Of A Use Case Diagram
3.Name Actors With Singular, Business-Relevant Nouns
4.Associate Each Actor With One Or More Use Cases
5.Actors Model Roles, Not Positions
6.Use <<system>> to Indicate System Actors
7.Actors Don’t Interact With One Another
8.Introduce an Actor Called "Time" to Initiate Scheduled Events
Relationships
There are several types of relationships that may appear on a use case diagram:
•An association between an actor and a use case
•An association between two use cases
•A generalization between two actors
•A generalization between two use cases
Ramakant Soni @ BKBIET Pilani 37
Enrolling students in a university