wxgc6102: object-oriented techniques object interaction – interaction overview diagrams timing...
TRANSCRIPT
![Page 1: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/1.jpg)
WXGC6102: Object-Oriented WXGC6102: Object-Oriented TechniquesTechniquesObject Interaction –
Interaction Overview DiagramsTiming Diagrams
References:
Chapter 9 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design Using UML, (3rd Edition), McGraw Hill, 2006.
Object-Oriented Technology - From Diagram to Code with Visual Paradigm for UML, Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung, McGraw-Hill Education (Asia), 2005
![Page 2: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/2.jpg)
Interaction Overview Interaction Overview DiagramsDiagrams
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.
![Page 3: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/3.jpg)
Interaction Overview Interaction Overview DiagramsDiagrams
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
![Page 4: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/4.jpg)
: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
![Page 5: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/5.jpg)
Interaction Fragment UsedInteraction Fragment Used
:Campaign :Advert
getCost
sd Get campaign budget
loop
getOverheads
checkCampaignBudget
:CampaignManager
[For all campaign’s adverts]
![Page 6: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/6.jpg)
Interaction Fragment UsedInteraction Fragment Used
:Campaign :Advert
Advert newAd:Advert
sd Create advert
![Page 7: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/7.jpg)
Interaction Fragment UsedInteraction Fragment Used
:Campaign :Advert
newRequest:Request Request
sd Create request
![Page 8: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/8.jpg)
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
![Page 9: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/9.jpg)
Timing DiagramsTiming Diagrams
A new feature in UML 2.0Show how time constraints affect
interactions between lifelinesThe sequence diagram Car enters car park is the basis for the subsequent timing diagram
![Page 10: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/10.jpg)
Timing DiagramsTiming Diagrams
:TicketMachine :Barrier after:WeightSensor
sd Car enters car park
raiseBarrier
lowerBarrier
before:WeightSensor
activate
Raised
Lowered
LoweredActive
deactivate
Blocked
barrierLowered
Inactive
ticketRequested
![Page 11: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/11.jpg)
Timing DiagramsTiming 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
![Page 12: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/12.jpg)
Model ConsistencyModel Consistency
Timing diagrams must be consistent with the relevant sequence diagrams and state machines.
![Page 13: WXGC6102: Object-Oriented Techniques Object Interaction – Interaction Overview Diagrams Timing Diagrams References: Chapter 9 of Bennett, McRobb and Farmer:](https://reader036.vdocuments.site/reader036/viewer/2022082612/56649f225503460f94c3aca9/html5/thumbnails/13.jpg)
ReferencesReferences
UML Reference Manual (OMG, 2004) Bennett, Skelton and Lunn (2005)
(For full bibliographic details, see Bennett, McRobb and Farmer)
Object-Oriented Technology - From Diagram to Code with Visual Paradigm for UML, Curtis H.K. Tsang, Clarence S.W. Lau and Y.K. Leung, McGraw-Hill Education (Asia), 2005