wordpress.com · web viewdraw sequence diagram of atm processing draw sequence diagram of assigned...

8
Software Engineering Lab # 09 LAB # 09 Objective To Understand Interaction diagram In UML. Theory Interaction diagrams describe how groups of objects collaborate in some behavior it typically captures the behavior of a single use case. Interaction diagrams do not capture the complete behavior, only typical scenarios. Analyzing a System’s Behavior UML offers two diagrams to model the dynamics of the system: sequence and collaboration diagrams. These diagrams show the interactions between objects. Sequence Diagrams A sequence diagram is a form of interaction diagram which shows objects as lifelines running down the page, with their interactions over time represented as messages drawn as arrows from the source lifeline to the target lifeline. Sequence diagrams are good at showing which objects communicate with which other objects; and what messages trigger those communications. Sequence diagrams are not intended for showing complex procedural logic. Sequence Diagram Components Object This box shape represents a class, or object, in UML. They demonstrate how an object will behave in the context of the system. Lifeline A dashed vertical line that represents the passage of time as it extends downward. Along with time, they represent the sequential events that occur to an object during the charted process. Lifelines may begin with a labeled rectangle shape or an actor symbol .

Upload: others

Post on 09-Mar-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

LAB # 09

ObjectiveTo Understand Interaction diagram In UML.

Theory

Interaction diagrams describe how groups of objects collaborate in some behavior it typically captures the behavior of a single use case. Interaction diagrams do not capture the complete behavior, only typical scenarios.

Analyzing a System’s BehaviorUML offers two diagrams to model the dynamics of the system: sequence and collaboration diagrams. These diagrams show the interactions between objects.

Sequence DiagramsA sequence diagram is a form of interaction diagram which shows objects as lifelines running down the page, with their interactions over time represented as messages drawn as arrows from the source lifeline to the target lifeline. Sequence diagrams are good at showing which objects communicate with which other objects; and what messages trigger those communications. Sequence diagrams are not intended for showing complex procedural logic.

Sequence Diagram Components

ObjectThis box shape represents a class, or object, in UML. They demonstrate how an object will behave in the context of the system.

LifelineA dashed vertical line that represents the passage of time as it extends downward. Along with time, they represent the sequential events that occur to an object during the charted process. Lifelines may begin with a labeled rectangle shape or an actor symbol

.

Activation boxes   Symbolized by a rectangle shape, an activation box represents the time needed for an object to complete a task. The longer the task will take, the longer the activation box becomes.

Page 2: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

Messages   Packet of information that are transmitted between objects. They may reflect the start and execution of an operation, or the sending and reception of a signal.

Synchronous messages Represented by a solid line with a solid arrow head. This symbol is used when a sender must wait for a response to a message before it continues most method calls in object-oriented programming languages are synchronous. A closed and filled arrowhead signifies that the message is sent synchronously

If you want to show that the receiver has finished processing the message and returns control to the sender, draw a dashed arrow from receiver to sender. Optionally, a value that the receiver returns to the sender can be placed near the return arrow.

Instantaneous messageMessages are often considered to be instantaneous, i.e. the time it takes to arrive at the receiver is negligible. For example, an in-process method calls. Such messages are drawn as a horizontal arrow.

Page 3: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

Sometimes however, it takes a considerable amount of time to reach the receiver. For example, a message across a network. Such a non-instantaneous message is drawn as a slanted arrow.

Found message

A found message is a message of which the caller is not shown. Depending on the context, this could mean that either the sender is not known, or that it is not important who the sender was. The arrow of a found message originates from a filled circle.

Asynchronous messagesWith an asynchronous message, the sender does not wait for the receiver to finish processing the message, it continues immediately. Messages sent to a receiver in another process or calls that start a new thread are examples of asynchronous messages. An open arrowhead is used to indicate that a message is sent asynchronously.

Page 4: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

Message to selfA message that an object sends itself can be shown as follows

GuardA message can include a guard, which signifies that the message is only sent if a certain condition is met. The guard is simply that condition between brackets.

Collaboration DiagramsThey are the same as sequence diagrams but without a time axis:

Their message arrows are numbered to show the sequence of message sending. They are less complex and less descriptive than sequence diagrams.

Page 5: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

Example-1

Sequence Diagram of Online Shopping System

Page 6: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

Example-2

Sequence diagram of e-mail message

Example-3

Page 7: WordPress.com · Web viewDraw Sequence diagram of ATM processing Draw Sequence diagram of assigned project Software Engineering Lab # 09 Author student Last modified by Aqsa Siddiqui

Software Engineering Lab # 09

Tasks

1. Draw Sequence diagram of ATM processing2. Draw Sequence diagram of assigned project