Sequence diagram
A sequence diagram is a form of an interaction diagram that shows the evolution of an object along a lifeline, and the interaction between objects over time is expressed as a message from the source lifeline to the target lifeline. The sequence diagram is a good indicator of how those objects communicate with other objects, what messages trigger these communications, and sequence diagrams do not show the logic of complex processes well.
Lifeline
A lifeline represents an independent participant in a sequence diagram. Represented as a rectangle containing the object name, if its name is "self", then the lifeline represents the class element that controls the sequence diagram.
Sometimes, a sequence diagram contains a lifeline that is the performer at the top. This situation shows that the use case is the master of this sequence diagram. Boundaries in a robust diagram, control and entity elements can also have lifelines.
News
The message is displayed as an arrow. Messages can be transmitted or lost and retrieved, either synchronously or asynchronously, either as a call or as a signal. In, the first message is a synchronous message (labeled Real arrow) that completes the transfer and implies a return message. The second message is an asynchronous message (marked as a solid arrow) and the third is an asynchronous return message (marked as a dashed line).
Execution occurs
The downward-stretched rectangular rectangle represents the activation of the execution event or control focus. There are three execution events in. The first one is that the source object sends two messages and receives two replies. The second one is that the target object receives a synchronous message and returns a reply. The third one is that the target object receives an asynchronous message and returns a reply.
Internal communication
An internal message behaves as a recursive invocation of an operation, or a method calls another method that belongs to the same object. Displays the nested control focus for the execution of events on the lifeline.
Lost messages and pickup messages
The lost messages are those sent without reaching the specified receiver, or the recipient is no longer in the current diagram. Pickup messages are received from unknown senders, or from senders that are not displayed in the current diagram. They all indicate whether to go to or from an endpoint element.
Lifeline Start and end
Lifelines can be created and destroyed in the sequence graph timescale range, and in the following example, the lifeline is terminated with a stop sign (fork). In the previous example, the symbol at the top of the lifeline (child) is displayed at a lower position than the object symbol (parent) that created it along the page. Displays the Create and Terminate objects.
Time and duration constraints
Messages are displayed by default as horizontal lines. Because lifelines are displayed as a time channel along the screen, it is important to consider the length of time required to perform the action when modeling a real-time system or modeling a business process with time constraints. Therefore, you can set a term constraint on the message so that the message appears as a slash.
Compound fragments
As previously mentioned, sequence diagrams are not suitable for expressing complex process logic. In one case, there are many mechanisms that allow some degree of process logic to be added to the diagram and put them under the title of the compound fragment. A compound fragment is one or more processing sequences that are contained in a frame and executed under the specified name. The fragments can be:
- The selective fragment (display "ALT") models the IF...THEN...ELSE structure.
- The option fragment (show "opt") models the "switch" structure.
- The interrupt fragment models the selectable order of the handled events, not the other parts of the diagram.
- Parallel fragments (showing "par") are modeled for concurrent processing.
- A weak sequential fragment (which displays "seq") contains a set of messages that must be processed before the subsequent fragment begins. However, the sequence of messages within the fragment is not imposed on messages that do not share the same lifeline.
- Strict sequential fragments (showing "strict") contain a series of messages that need to be processed in a given order.
- Non-fragment (display "Neg") contains a series of unavailable messages.
- Key fragments have a critical section.
- Ignoring a fragment declares a meaningless message if it appears in the current context.
- Considering fragments is the opposite of ignoring fragments, messages that are not included in the considered fragments should be ignored.
- The assertion fragment (which displays "assert") indicates that any order that is not displayed as a declared operand is invalid.
- The Loop fragment contains a series of repeated messages.
The loop fragment is displayed:
This is also an interaction that resembles a compound fragment. The interaction occurs by another map reference, shown as the upper-left corner with "ref", and the reference map name is displayed in the middle of the box.
Door
A gate is a connection point that connects messages within a fragment and out-of-clip messages. In the EA, the door is displayed as a small square on the fragment frame. function as a sequence diagram with a connector outside the page. Used to indicate the source of the incoming message, or the end of the message. The following two graphs show their use in practice. Note: The door in "Top level diagram" uses the message arrow to point to the reference fragment, where it is not necessary to draw it as a block.
??
Partial decomposition
An object can draw multiple lifelines so that messages inside and between objects are displayed on the same graph.
State Constants/Continuations
The state constant is the constraint of the lifeline, and the runtime is always true. A rectangle displayed as a semicircle on both sides, such as:
Continuation, while having the same label as a State constant, is used for compound fragments and can extend across multiple lifelines.
??
UML sequence diagram