16
NO
Usecasemodel,classdiagramandoneof
theinteractiondiagramforasimple
system
Statechartdiagramincaseofmanystate
changes
Deploymentdiagramincaseoflarge
numberofhardwarecomponents
ARE ALL VIEWS REQUIRED?
17
USE CASE MODEL
Consistsofsetof“usecases”
Animportantanalysisanddesignartifact
Othermodelsmustconfirmtothismodel
Notreallyanobject-orientedmodel
Representsafunctionalorprocessmodel
18
USE CASES
Differentwaysinwhichsystemcanbeusedby
theusers
Correspondstothehigh-levelrequirements
Representstransactionbetweentheuserandthe
system
Definebehaviorwithoutrevealinginternal
structureofsystem
Setofrelatedscenariostiedtogetherbya
commongoal
19
USE CASES
Usecasesareindependentofeachother
Implicitdependenciesmayexist
20
EXAMPLE OF USE CASES
For library information system
issue-book
Query-book
Return-book
Create-member
Add-book, etc.
21
REPRESENTATION OF USE CASES
Representedbyusecasediagram
Usecaseisrepresentedbyellipse
Systemboundaryisrepresentedby
rectangle
Usersarerepresentedbystickpersonicon
(actor)
Communicationrelationshipbetween
actorandusecasebyline
Externalsystembystereotype
22
EXAMPLE OF USE CASES
TIC-TAC-TOE
Use case model
Tic-tac-toe game
Play Move
Player
26
FACTORING USING
GENERALIZATION
Pay membership fee
Pay through library pay cardPay through credit card
Use case generalization
INCLUDES
Involvesoneusecaseincludingthebehaviorof
anotherusecaseinitssequenceofeventsand
actions.
Theincludesrelationshipoccurswhenachunkof
behaviorthatissimilaracrossanumberofusecases.
Asshowninfig.,theincludesrelationshipis
representedusingapredefinedstereotype
<<include>>.
27
28
FACTORING USING INCLUDES
Base use case
Use case inclusion
Common
use case
<<include>>
Issue Book
Update
selected
book
Get user
selection
Check for
reservation
Renew Book
<<include>>
<<include>>
<<include>>
<<include>>
Paralleling model
30
FACTORING USING EXTENDS
Base
use case
Use case extension
Common
use case
<<extends>>
ORGANIZATION OF USE CASES
Whentheusecasesarefactored,theyare
organizedhierarchically.
Thehigh-levelusecasesarerefinedintoaset
ofsmallerandmorerefinedusecasesas
showninfig.
Top-levelusecasesaresuper-ordinatetothe
refinedusecases. 31
ORGANIZATION OF USE CASES
Therefinedusecasesaresub-ordinatetothe
top-levelusecases.
Onlythecomplexusecasesshouldbe
decomposedandorganizedinahierarchy.
Thislevelisalsoreferredtoasthecontext
diagram.
32
33
HIERARCHICAL ORGANIZATION
OF USE CASES
Hierarchical organization of use cases
External users
use case 1
use case 2
use case 3
use case 3.1
use case 3. 2
use case 3.3
use case 1
use case 2
use case 3
Subsystems
Method
40
EXAMPLE OF CLASS DIAGRAM
Different representations of the LibraryMember class
LibraryMember
Member Name
Membership Number
Address
Phone Number
E-Mail Address
Membership Admission Date
Membership Expiry Date
Books Issued
issueBook( );
findPendingBooks( );
findOverdueBooks( );
returnBook( );
findMembershipDetails( );
LibraryMember
Member Name
Membership Number
Address
Phone Number
E-Mail Address
Membership Admission Date
Membership Expiry Date
Books Issued
LibraryMember
41
ASSOCIATION RELATIONSHIP
Enableobjectstocommunicatewitheach
other
Describesaconnectionbetweenclasses.
Theassociationrelationbetweentwo
objectsiscalledobjectconnectionor
link.
Usuallybinaryrelationbutmoreclasses
canbeinvolved
58
SEQUENCEDIAGRAM
Messagelabelledwithmessagename
Messagecanbelabelledwithcontrol
information
Twotypesofcontrolinformation:
condition([])&aniteration(*)
EXAMPLE OFSEQUENCE
DIAGRAM
Thesequencediagramforthebookrenewal
usecasefortheLibraryAutomationSoftware
isshowninfig.
59
60
EXAMPLE OF SEQUENCE
DIAGRAM
:Library
Boundary
:Library
Book
Renewal
Controller
:Library
Book
Register
:Book
:Library
Member
renewBook
displayBorrowing
selectBooks
[reserved]
apology
confirm
find MemberBorrowing
bookSelected
* find
update
[reserved]
apology
confirm
updateMemberBorrowing
Sequence Diagram for the renew book use case
63
EXAMPLE OF
COLLABORATION DIAGRAM
:Library
Boundary
:Library
Book
Renewal
Controller
:Library
Book
Register
:Book
:Library
Member
1: renewBook
3: display
Borrowing
4: selectBooks
[reserved]
8: apology
12: confirm
2: findMemberBorrowing
5: book
Selected
6: * find
9: update
[reserved]
7: apology
10: confirm
updateMemberBorrowing
Collaboration Diagram for the renew book use case
EXAMPLE OF ACTIVITY
DIAGRAM
ThestudentadmissionprocessinIITisshownasan
activitydiagram.Thisshowsthepartplayedby
differentcomponentsoftheInstituteintheadmission
procedure.Afterthefeesarereceivedattheaccount
section,parallelactivitiesstartatthehosteloffice,
hospital,andtheDepartment.Afterallthese
activitiescomplete(thissynchronizationis
representedasahorizontalline),theidentitycardcan
beissuedtoastudentbytheAcademicsection.
67
68
EXAMPLE OF ACTIVITY
DIAGRAM
check
student
records
Academic Section
receive
fees
allot
room
receive
fees
allot
hostel
create
hospital
record
conduct
medical
examination
register
in
course
Accounts Section Hostel Office Hospital Department
issue
identity card
Activity diagram for student admission procedure at IIT
69
STATE CHART DIAGRAM
BasedontheworkofDavidHarel[1990]
Modelhowthestateofanobjectchangesinits
lifetime
Describehowthebehavioroftheobjectchanges
acrossseveralusecaseexecution.
Basedonfinitestatemachine(FSM)formalism
EXAMPLE OFSTATECHART
DIAGRAM
An example of state chart for the order
object of the Trade House Automation
software is shown in fig.
72
73
EXAMPLE OF STATE CHART
DIAGRAM
Unprocessed
Order
Fulfilled
Order
Pending
Order
Accepted
Order
Rejected
Order
order received
[reject] checked
[accept] checked
[some items not
available] processed
[all items
available]
newsupply
[some items available]
processed / deliver
Example: State chart diagram for an order object