Sequence Diagram
Sequence diagram describes an interaction by focusing on the sequence of messages that are exchanged, along with their corresponding occurrence specifications on the lifelines.

Lifeline
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.
Information identifying the lifeline is displayed inside the rectangle in the following format (slightly modified from what's in UML 2.4 standard):
lifeline-ident ::= [ connectable-element-name [ '[' selector ']' ]] [ ':' class-name ] [ decomposition ] | 'self'
selector ::= expression
decomposition ::= 'ref' interaction-ident [ 'strict' ]
The naming convention is similar to the communication diagram, so I won't specify further

Gate
A message from or to the outside of the current scope. Think of the user interaction, or an out of company API call.
The gates are named implicitly or explicitly. Implicit gate name is constructed by concatenating the direction of the message (
inorout) and the message name, e.g.in_search,out_read.Gates are notated just as message connection points on the frame.
Interaction Fragment
Interaction fragment is a named element representing the most general interaction unit. Each interaction fragment is conceptually like an interaction by itself.
There is no general notation for an interaction fragment. Its subclasses define their own notation.
Examples of interaction fragments
- occurrence
- execution
- state invariant
- combined fragment
- interaction use
Occurrence
Occurrence (complete UML name - occurrence specification, i.e. "event description") is interaction fragment which represents a moment in time (event) at the beginning or end of a message or at the beginning or end of an execution.
Each occurrence specification appears on exactly one lifeline. Occurrence specifications of a lifeline are ordered along the lifeline.
Occurrence specification has no notation and is just a point at the beginning or end of a message or at the beginning or end of an execution specification.
Examples of occurrences
- message occurrence
- execution occurrence
Message occurence
Signals or method calls, sometimes interaction with the outside (gates)
Destruction occurence

The destruction of the instance described by the lifeline.
No other occurrence may appear below the destruction event on a given lifeline.
Execution

As an occurence
Represents moments in time at which actions or behaviors start or finish.
Execution occurrence references exactly one execution specification which describes the execution that is started or finished at this execution occurrence.
As an interaction fragment
Represents a period in the participant's lifetime when it is
- executing a unit of behavior or action within the lifeline,
- sending a signal to another participant,
- waiting for a reply message from another participant.
Note, that the execution specification includes the cases when behavior is not active, but just waiting for reply.
The duration of an execution is represented by two execution occurrences - the start occurrence and the finish occurrence.
By the way
It's nothing but a thin grey or white rectangle on the lifeline.
Signals
A line in order to emphasize that the whole action is associated with only one occurrence specification (and start and finish associations refer to the same occurrence specification).

Overlapping execution specifications on the same lifeline - message to self.

Overlapping execution specifications on the same lifeline - callback message.
Arrows
| Icon | Meaing |
|---|---|
![]() |
Simple, syncronous message |
![]() |
Asyncronous message |
![]() |
Asyncronous return message, or syncronous reply |
![]() |
Asyncronous create message |
![]() |
Destroy message |
State invariant
Guards either on some condition, or the state of the object:

Interaction Use
Basically a bunch of interactions grouped together or abstracted to make the diagram simpler
Interaction use works as:
- Copy the contents of the referred interaction to where this interaction needs to be used,
- Substitute formal parameters with arguments,
- Connect the formal gates with the actual ones.

The syntax of the interaction use of the ref operator is:
interaction-use ::= [ attribute-name '=' ] [ collaboration-use '.' ] interaction-name [ io-arguments ] [ ':' return-value ]
io-arguments ::= '(' io-argument [ ',' io-argument ]* ')'
io-argument ::= in-argument | 'out' out-argument
This group can be detailed in another sequence diagram, so yo can keep this one nice and clean




