System Level Design Languages:Sequence Diagram

Sequence Diagram

In a system, various objects communicate with each other by sending and receiving messages. This gives a lifeline to an object, which begins from the time it is created to the time it receives no more messages. The lifeline of the MemModel object is shown in the example diagram of Figure 86.9. A sequence diagram shows the interaction between different objects in a system and depicts their lifelines. An example of a sequence diagram is shown in Figure 86.10; interaction between BoardPanel, ParallelPort, Sayeh, and Memory objects are shown in this figure. This diagram is in the category of the interaction diagrams. Other interaction diagrams include communication, timing, and interaction overview diagrams. Lifelines and messages construct a sequence diagram. The following paragraphs present more details of lifelines and messages.

As stated above, the lifeline of an object shows the duration in which the object sends/receives messages to/from other objects. In UML, an object lifeline is displayed with a vertical line. A thin rectangle is used in several sections of this vertical line, which is called an execution occurrence. This rectangle shows the times in which that object is active (working due to a message). The name of the object is displayed in a rectangle on top of the lifeline and message names are shown on horizontal lines leading to the lifeline. Time increases from top to bottom in this diagram. Figure 86.9 shows an example of a lifeline.

System Level Design Languages-0205

A sequence diagram object can be used for elements such as an actor, a boundary, a control, or an entity. A lifeline is created and destroyed dynamically in sequence diagrams. It can be created (e.g., in C++ it can be newed) or deleted by another object. Lifelines can have constraints. This means that they can have a condition that must be true at run-time for activating that object. An object can have more than one lifeline. For this purpose, an object must be partitioned into different parts, with each part having its own lifeline. Partitioning an object makes use of the intra-object message passing. The partitions are displayed by vertical lines in the object rectangle.

Messages in sequence diagrams show communications between two objects. These messages are displayed by arrows with the name (or description) of a message. Messages are of different kinds: complete, lost, or found. They can be synchronous or asynchronous. They can also be call or signal. A lost message is a message whose destination is either not specified in the sequence diagram or does not exist at all. Found messages are messages whose source object does not exist in the diagram. The source and destination of a message can be the same lifeline. These messages are called self-messages. They show the communication between different parts of an object or a recursion in an object.

In several cases, e.g., in real-time systems, it is critical for a message to have timeout, or to be processed in a certain time limit. Therefore, messages in sequence diagrams can have timing constraints. These messages are shown with sloping lines.

For more advanced and complex sequence diagrams, combined fragments can be used. A combined fragment groups portions of several lifelines into a fragment. A fragment uses a keyword such as alt, opt, par, seq, strict, neg, loop, assert, etc. For example, a parallel fragment (denoted by par) models a portion of a sequence diagram, which has concurrent processing. In Figure 86.10, the areas with loop N on top of them are combined fragments. We can reference a sequence diagram in another sequence diagram by the ref keyword above the referenced diagram. The example of Figure 86.10 is a sequence diagram for a portion of the SSimBoard system.

Comments

Popular posts from this blog

SRAM:Decoder and Word-Line Decoding Circuit [10–13].

ASIC and Custom IC Cell Information Representation:GDS2

Timing Description Languages:SDF