Sequence Diagrams
Sequence Diagrams
Interaction Diagrams
• UML Specifies a number of interaction diagrams to model dynamic
aspects of the system
• Dynamic aspects of the system
• Messages moving among objects/classes
• Flow of control among objects
• Sequences of events
Dynamic Diagram Types
• Interaction Diagrams - Set of objects or roles and the messages that can be
passed among them.
• Sequence Diagrams - emphasize time ordering
• Communication Diagrams - emphasize structural ordering
• State Diagrams
• State machine consisting of states, transitions, events and activities of an
object
• Activity & Swimlane Diagrams
• Emphasize and show flow of control among objects
Sequence Diagrams
• Describe the flow of messages, events, actions between objects
Time=B
execution
lifeline
Components
Method call
Return value
Components
c : Client o : ODBCProxy
create() :
Transaction
setActions(a, b, c)
setValues(a, 3, 4)
setValues(b, c, 7)
(committed)
destroy()
create()
destroy()
Synchronous message
Asynchronous message
Return message
Async Message Example
Synchronous message
Asynchronous message
Return message
Components: alt/else
Components: option
Components: loop
Rules of thumb
• Rarely use options,loops,alt/else
• These constructs complicate a diagram and make them
hard to read/interpret.
• Frequently it is better to create multiple simple diagrams