0% found this document useful (0 votes)
11 views41 pages

Lecture 06 - Sda (Aft)

Software design architecture

Uploaded by

Faiz Ali khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views41 pages

Lecture 06 - Sda (Aft)

Software design architecture

Uploaded by

Faiz Ali khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 41

NATIONAL UNIVERSITY OF MODERN LANGUAGES

Faculty of Engineering and Computing


Department of Software Engineering
SOFTWARE DESIGN AND ARCHITECTURE

LECTURE NO. 6

Introduction to Software Engineering Design

Course Instructor: Mr. Ahsan Arif


Lecturer
Department of Software Engineering
NUML Islamabad

Date: March 18, 2024 Software Engineering Design: Theory and Practice 2
LECTURE CONTENTS
 Introduction to Sequence Diagram (Process View)
 What is sequence diagram?
 What are the different parts of sequence diagram?
o Message passing and its types
o Loop and condition in sequence diagram
o Frames in sequence diagram
 How to draw sequence diagram?
 Example of drawing sequence diagram with Case Study

Date: March 18, 2024 Software Engineering Design: Theory and Practice 3
UML – SEQUENCE DIAGRAM
Introduction to SEQUENCE diagram
Sequence diagram is also called an event diagram or event scenario.

Sequence diagram = Event diagram or Event scenario

The UML diagram which shows an interaction between objects arranged in


a time sequence is a Sequence Diagram.

Interaction Diagram

Collaboration Diagram Sequence Diagram

Date: March 18, 2024 Software Engineering Design: Theory and Practice 4
What is SEQUENCE diagram?
 The sequence diagram is an interaction diagram that shows details on
how operations are carried out like what messages are sent and when.
 Sequence Diagram illustrates
o how the different parts of a system interact with each other to carry
out a function, and
o the order in which the interactions occur when a particular use case is
executed.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 5
SEQUENCE – Diagram
 Objects of the classes communicate by sending and receiving messages

Date: March 18, 2024 Software Engineering Design: Theory and Practice 6
SEQUENCE – Diagram
 A sequence diagram is structured in such a way that it represents a
timeline that begins at the top and descends gradually to mark the
sequence of interactions. Each object has a column and the messages
exchanged between them are represented with arrows.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 7
Different parts of SEQUENCE Diagram
1. Dimension:
 A sequence diagram is drawn in two dimensions, Horizontal and
Vertical.
‒ Object Dimension
‒ Time Dimension

Date: March 18, 2024 Software Engineering Design: Theory and Practice 8
Different parts of SEQUENCE Diagram
1. Dimension:
 A sequence diagram is drawn in two dimensions, Horizontal and
Vertical.
‒ Object Dimension
‒ Time Dimension

Date: March 18, 2024 Software Engineering Design: Theory and Practice 9
Different parts of SEQUENCE Diagram
2. Actor:
 Anyone how use to perform a certain function in the system is actors.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 10
Different parts of SEQUENCE Diagram
3. Lifeline:
 A lifeline represents an individual participant in the interaction.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 11
Different parts of SEQUENCE Diagram
4. Activation:
 A thin rectangle box on a lifeline represents the time needed for an
object to complete a task.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 12
Different parts of SEQUENCE Diagram
5. Message:
 A message defines a particular communication between Lifelines of
an interaction.
5.1. Synchronous Messages
This message is used when a sender must wait for a response to a
message before it continues.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 13
Different parts of SEQUENCE Diagram
5. Message:
5.2. Asynchronous Messages
An asynchronous message does not wait for a response from the
receiver before the sender continues.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 14
Different parts of SEQUENCE Diagram
5. Message:
5.3. Return Message
A return message is used to indicate that the message receiver is done
processing the message and is returning control over to the message
caller.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 15
Different parts of SEQUENCE Diagram
5. Message:
5.4. Create Message
To represent the new object created in the process of the execution,
create a message is used.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 16
Different parts of SEQUENCE Diagram
5. Message:
5.5. Reflexive Messages
Sometimes an object needs to communicate with the same class
methods.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 17
Different parts of SEQUENCE Diagram
5. Message:
5.6. Object Destruction
As soon as the object does not need any more in further process, object
destruction is called which is deleting the object.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 18
Different parts of SEQUENCE Diagram
5. Message:
5.7. Comment
A comment or note can be used to reflect the various remarks to the
elements.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 19
Different parts of SEQUENCE Diagram
6. Focus of Control:
The focus of control indicates times during activation when processing
is taking place within that object.
Waiting Time

Execution Time

Date: March 18, 2024 Software Engineering Design: Theory and Practice 20
Different parts of SEQUENCE Diagram
7. Control Object:
The control object is to manage the collaboration of objects which gives
effect to the Use Case Process.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 21
Different parts of SEQUENCE Diagram
8. Boundary Object:
Most use cases imply at least one boundary object that manages the
dialogue between the actor and the system.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 22
Different parts of SEQUENCE Diagram
9. Guards:
When modeling object interactions, there may be a certain condition that
must be met for a message to be sent to the object. To model conditions,
like if condition in programming, we use guards in sequence diagrams.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 23
Different parts of SEQUENCE Diagram
10. Alternative:
Alternative in sequence diagram symbolizes a choice between two or
more message sequences. To model a choice of the message with a
condition like if – else condition in programming, we use an alternative.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 24
Different parts of SEQUENCE Diagram
11. Optional:
Optional is similar to Guards where the fragment executes only if the
supplied condition is true.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 25
Different parts of SEQUENCE Diagram
12. Parallel:
In parallel, each fragment is run in parallel. If the condition is match,
each fragment or the message will execute parallel.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 26
Different parts of SEQUENCE Diagram
13. Loops:
The fragment may execute multiple times which may be need to model
in a diagram. Loops fragment is used to represent a repetitive sequence
and it is very similar in appearance to the optional.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 27
Different parts of SEQUENCE Diagram

Date: March 18, 2024 Software Engineering Design: Theory and Practice 28
Different parts of SEQUENCE Diagram
14. Sequence Diagram:
The entire sequence diagram is surround by the box or frame and inside
the frame’s name, label with text sd:Process Name.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 29
Different parts of SEQUENCE Diagram
Beside these, there are other notation like
Negative: The fragment shows an invalid interaction.
Reference: refers to an interaction defined on another diagram. The frame
is drawn to cover the lifelines involved in the interaction. You can define
parameters and a return value.

Date: March 18, 2024 Software Engineering Design: Theory and Practice 30
How to Draw a Sequence Diagram

1 Find the Domain Classes

Date: March 18, 2024 Software Engineering Design: Theory and Practice 31
How to Draw a Sequence Diagram

2 Control Object Lifeline

Date: March 18, 2024 Software Engineering Design: Theory and Practice 32
How to Draw a Sequence Diagram

3 Boundary Object Lifeline

Date: March 18, 2024 Software Engineering Design: Theory and Practice 33
How to Draw a Sequence Diagram

4 Actor Lifeline

Date: March 18, 2024 Software Engineering Design: Theory and Practice 34
How to Draw a Sequence Diagram

5 Adding Messages

Date: March 18, 2024 Software Engineering Design: Theory and Practice 35
How to Draw a Sequence Diagram

6 Draw Object Lifeline

Date: March 18, 2024 Software Engineering Design: Theory and Practice 36
How to Draw a Sequence Diagram

Date: March 18, 2024 Software Engineering Design: Theory and Practice 37
How to Draw a Sequence Diagram

Date: March 18, 2024 Software Engineering Design: Theory and Practice 38
How to Draw a Sequence Diagram

Date: March 18, 2024 Software Engineering Design: Theory and Practice 39
References

1. https://creately.com/guides/sequence-diagram-tutorial/
2. https://robhosking.com/14-sequence-diagram-activity-diagram/

Date: March 18, 2024 Software Engineering Design: Theory and Practice 40
Thank You...

Mr. Ahsan Arif


Lecturer (Dept. of Software Engineering)
[email protected]

You might also like