View
225
Download
3
Category
Tags:
Preview:
Citation preview
© 2010 Bennett, McRobb and Farmer 1
Object Interaction – Interaction Overview Diagrams
Timing DiagramsBased on Chapter 09
Bennett, McRobb and Farmer
Object Oriented Systems Analysis and Design Using UML
4th Edition, McGraw Hill, 2010
© Bennett, McRobb and Farmer 2005 2
In This Lecture You Will Learn:
• how to model interactions using interaction overview diagrams;
• how to model interaction using an interaction sequence diagram;
• how to use timing diagrams.
© Bennett, McRobb and Farmer 2005 3
Interaction Overview Diagrams
• Variants of activity diagrams (see Ch 5)• Focuses on the flow of control in an interaction• Nodes in the diagram may be interactions or
interaction occurrences• Interaction needs to be broken down into its key
elements.
© Bennett, McRobb and Farmer 2005 4
Interaction Overview Diagrams
• An alternative version of the sequence diagram Add a new advert to a campaign if within budget is shown on the next slide and is used to develop an interaction overview diagram
© Bennett, McRobb and Farmer 20055
:Client :Campaign :Advert
getName
listCampaigns ref
:CampaignManager
alt
[else]
sd Add a new advert to a campaign if within budget
List client campaigns
[totalCost <= budget]
refCreate advert
Create requestref
ref
Get campaign budget
addCostedAdvert
© Bennett, McRobb and Farmer 2005 6
Interaction Fragment Used
:Campaign :Advert
getCost
sd Get campaign budget
loop
getOverheads
checkCampaignBudget
:CampaignManager
[For all campaign’s adverts]
© Bennett, McRobb and Farmer 2005 7
Interaction Fragment Used
:Campaign :Advert
Advert newAd:Advert
sd Create advert
© Bennett, McRobb and Farmer 2005 8
Interaction Fragment Used
:Campaign :Advert
newRequest:Request Request
sd Create request
© Bennett, McRobb and Farmer 2005
9
refGet campaign budget
[totalCost <= budget]
refCreate advert Create request
ref
:Campaign:CampaignManage
r addCostedAdvert
sd Add costed advert
[totalCost > budget]
sd Add a new advert to a campaign if within budget
:Client :CampaigngetName
listCampaigns
getCampaignDetails
:CampaignManage
r
sd List Campaigns for Client
loop [For all client’s campaigns]
Decision
Interaction occurrence In-line sequence diagram
Initial node
Final node
© Bennett, McRobb and Farmer 2005 10
Timing Diagrams
• A new feature in UML 2.0
• Show how time constraints affect interactions between lifelines
• The sequence diagram Car enters car park is the basis for the subsequent timing diagram
© Bennett, McRobb and Farmer 2005 11
Timing Diagrams
:TicketMachine :Barrier after:WeightSensor
sd Car enters car park
raiseBarrier
lowerBarrier
before:WeightSensor
activate
Raised
Lowered
LoweredActive
deactivate
Blocked
barrierLowered
Inactive
ticketRequested
© Bennett, McRobb and Farmer 2005 12
Timing Diagrams
sd Car enters car park lifelines :Barrier, :TicketMachine
:Ba
rrie
r:T
ick
etM
ac
hin
e
Lowered
Raised
Inactive
Active
Blocked
t
{t..t+3s}Timing Constraint
raiseBarrier
barrierLowered
Diagram has two instances, one for each lifeline
Sloped line represents duration of state change
Message from one lifeline to another
© Bennett, McRobb and Farmer 2005 13
Model Consistency
• Timing diagrams must be consistent with the relevant sequence diagrams and state machines.
© Bennett, McRobb and Farmer 2005 14
Summary
In this lecture you have learned about:
• how to model interactions using interaction overview diagrams;
• how to model interaction using an interaction sequence diagram;
• how to use timing diagrams.
© Bennett, McRobb and Farmer 2005 15
References
• UML Reference Manual (OMG, 2009)
• Bennett, Skelton and Lunn (2005)
(For full bibliographic details, see Bennett, McRobb and Farmer)
Recommended