uml sequence diagrams - lpu guide...definition •sequence diagram is the most common kind of...
TRANSCRIPT
![Page 1: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/1.jpg)
UML Sequence Diagrams
![Page 2: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/2.jpg)
Definition
• Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines.
• Sequence diagram describes an interaction by focusing on the sequence of messages that are exchanged, along with their corresponding occurrence specifications on the lifelines.
![Page 3: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/3.jpg)
![Page 4: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/4.jpg)
Lifeline
• Lifeline is a named element which represents an individual participant in the interaction.
• A lifeline is shown using a symbol that consists of a rectangle forming its "head" followed by a vertical line (which may be dashed) that represents the lifetime of the participant.
![Page 5: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/5.jpg)
Gate
• A gate is a message end, connection point for relating a message outside of an interaction fragment with a message inside the interaction fragment.
![Page 6: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/6.jpg)
Interaction Fragment
• Interaction fragment is a named element representing the most general interaction unit.
• Examples of interaction fragments are: • occurrence
• execution
• state invariant
• combined fragment
• interaction use
![Page 7: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/7.jpg)
Occurrence
• Occurrence (complete UML name - occurrence specification, i.e. "event description") which represents a moment in time (event)
• at the beginning or end of a message or
• at the beginning or end of an execution.
• FOC
• Examples of occurrences are:• message occurrence• execution occurrence
![Page 8: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/8.jpg)
Message Occurrence
• which represents such events as sending and receiving of signals or invoking or receiving of operation calls. • Destruction Occurrence
• which represents the destruction of the instance described by the lifeline. No other occurrence may appear below the destruction event on a given lifeline.
• The destruction of instance is depicted by a cross in the form of an X at the bottom of a lifeline.
![Page 9: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/9.jpg)
Execution Occurrence
• which represents moments in time at which actions or behavior start or finish.
![Page 10: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/10.jpg)
Execution
• Execution (full name - execution specification, informally called activation) is interaction fragment which represents a period in the participant's lifetime when it is• executing a unit of behavior or action,
• sending a signal to another participant,
• waiting for a reply message from another participant
![Page 11: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/11.jpg)
![Page 12: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/12.jpg)
State Invariant
• represents a runtime constraint on the participants of the interaction.
• It may be used to specify different kinds of constraints, such as • values of attributes or variables,
• internal or external states, etc.
![Page 13: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/13.jpg)
Interaction Use
• which allows to use (or call) another interaction.• Large and complex sequence diagrams could be simplified with interaction
uses.
• It is also common to reuse some interaction between several other interactions.
• The interaction use is shown as a combined fragment with operator ref.
![Page 14: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/14.jpg)
UML Message
• Message is a named element that defines one specific kind of communication between lifelines of an interaction. • The message specifies not only the kind of communication, but also the
sender and the receiver.
• A message is shown as a line from the sender message end to the receiver message end.
![Page 15: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/15.jpg)
Messages by Action Type
• A message reflects either an operation call and start of execution or a sending and reception of a signal.
• Depending on the type of action that was used to generate the message, message could be one of: • synchronous call
• asynchronous call
• asynchronous signal
• create
• delete
• reply
![Page 16: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/16.jpg)
Synchronous Call
• Synchronous call typically represents operation call - send message and suspend execution while waiting for response.
• Synchronous call messages are shown with filled arrow head.
![Page 17: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/17.jpg)
Asynchronous Call
• Asynchronous call - send message and proceed immediately without waiting for return value.
• Asynchronous messages have an open arrow head.
![Page 18: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/18.jpg)
Create Message
• Create message is sent to a lifeline to create itself.
• It is shown as a dashed line with open arrowhead and pointing to the created lifeline's head.
![Page 19: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/19.jpg)
Delete Message
• Delete message (called stop in previous versions of UML) is sent to terminate another lifeline.
• The lifeline usually ends with a cross in the form of an X at the bottom denoting destruction occurrence.
![Page 20: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/20.jpg)
Reply Message
• Reply message to an operation call is shown as a dashed line with open arrow head (looks similar to creation message).
![Page 21: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/21.jpg)
Messages by Presence of Events
• Lost Message
• is a message where the sending event is known, but there is no receiving event. It is interpreted as if the message never reached its destination. • Lost messages are denoted with as a small black circle at the arrow end of the
message.
![Page 22: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/22.jpg)
• Found Message
• is a message where the receiving event is known, but there is no (known) sending event. • It is interpreted as if the origin of the message is outside the scope of the
description.
• This may for example be noise or other activity that we do not want to describe in detail.
• Found Messages are denoted with a small black circle at the starting end of the message.
![Page 23: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/23.jpg)
Combined Fragment
• Combined fragment is an interaction fragment which defines a combination of interaction fragments.
• Combined fragment may have interaction constraints also called guards
![Page 24: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/24.jpg)
Types of Interaction fragments
• alt - alternatives
• opt - option
• loop - iteration
• break - break
• par - parallel
• strict - strict sequencing
• seq - weak sequencing
• critical - critical region
![Page 25: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/25.jpg)
The interaction operator alt means that the combined fragment represents a choice or alternatives of behavior. At most one of the operands will be chosen.
The interaction operator opt means that the combined fragment represents a choice of behavior where either the (sole) operand happens or nothing happens.
![Page 26: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/26.jpg)
Loop
![Page 27: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/27.jpg)
Break Parallel
![Page 28: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/28.jpg)
Strict Sequencing
Weak Sequencing
![Page 29: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/29.jpg)
Critical Region
A critical region is a region with traces that cannot be interleaved by other occurrence
![Page 30: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/30.jpg)
Communication Diagrams
Also called collaboration diagram
![Page 31: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/31.jpg)
• Communication diagram provides the same information as provided by sequence diagrams but in different way.
• In sequence diagrams we pay attention on time and sequence order but in communication(collaboration) diagram we more emphasis on interaction messages between objects.
![Page 32: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/32.jpg)
![Page 33: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/33.jpg)
![Page 34: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/34.jpg)
• Object are represents with rectangles.
• Messages are represented with an arrow and sequence number.
• Conditional statements are denoted by square brackets ‘ [ ]”.
• We can also combine sequence numbers by grouping them using decimal numbers.
![Page 35: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/35.jpg)
![Page 36: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/36.jpg)
Examples
![Page 37: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/37.jpg)
Sequence diagram for ATM
![Page 38: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/38.jpg)
Communication Diagram for ATM
![Page 39: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/39.jpg)
Sequence diagram for issuing a book
![Page 40: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/40.jpg)
Collaboration diagram for issuing a book
![Page 41: UML Sequence Diagrams - LPU GUIDE...Definition •Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines](https://reader033.vdocuments.us/reader033/viewer/2022060713/6079d68f179c9f6af947e174/html5/thumbnails/41.jpg)
Thank you