Download presentation
Presentation is loading. Please wait.
1
Interaction Diagrams Software Engineering BIT8
2
Interaction Diagrams A series of diagrams describing the dynamic behavior of an object-oriented system. A set of messages exchanged among a set of objects within a context to accomplish a purpose. Often used to model the way a use case is realized through a sequence of messages between objects. The purpose of Interaction diagrams is to: –Model interactions between objects –Assist in understanding how a system (a use case) actually works –Verify that a use case description can be supported by the existing classes –Identify responsibilities/operations and assign them to classes
3
Interaction Diagrams UML Collaboration Diagrams Emphasizes structural relations between objects Sequence Diagram The subject of this Lab
4
Sequence Diagrams Illustrates how objects interacts with each other. Emphasizes time ordering of messages. Can model simple sequential flow, branching, iteration, recursion and concurrency.
5
UML sequence diagrams Used during requirements analysis To refine use case descriptions to find additional objects (“participating objects”) Used during system design to refine subsystem interfaces Classes are represented by columns Messages are represented by arrows Activations are represented by narrow rectangles Lifelines are represented by dashed lines selectZone() pickupChange() pickUpTicket() insertCoins() Passenger TicketMachine
6
Nested messages The source of an arrow indicates the activation which sent the message An activation is as long as all nested activations Horizontal dashed arrows indicate data flow Vertical dashed lines indicate lifelines selectZone() Passenger Zone Selection F. TarifScheduleDisplay lookupPrice(selection) displayPrice(price) price Dataflow …to be continued...
7
Iteration & condition Iteration is denoted by a * preceding the message name Condition is denoted by boolean expression in [ ] before the message name Passenger ChangeProcessor insertChange(coin) CoinIdentifierDisplayCoinDrop displayPrice ( billed Amount) lookupCoin(coin) price [billed Amount<0] returnChange(-billedAmount) Iteration Condition …to be continued... …continued from previous slide... *
8
Creation and destruction Creation is denoted by a message arrow pointing to the object. Destruction is denoted by an X mark at the end of the destruction activation. In garbage collection environments, destruction can be used to denote the end of the useful life of an object. Passenger ChangeProcessor …continued from previous slide... Ticket createTicket(selection) free() Creation Destruction print()
9
Sequence Diagram Summary UML sequence diagram represent behavior in terms of interactions. Useful to find missing objects. Time consuming to build but worth the investment. Complement the class diagrams (which represent structure).
10
Thank You!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.