Software Engineering Lecture - Sequence Diagram
Software Engineering Lecture - Sequence Diagram
Engineering
(Fall 2019)
Sequence Diagrams
04/30/2020 CSE291 - Introduction to Software Engineering 2
Beginnings of a Method
Systems
Model
04/30/2020 CSE291 - Introduction to Software Engineering 3
Interaction Models
• This can be user interaction, which involves user inputs and outputs
• Interaction between the system being developed and other systems
• Or interaction between the components of the system
• The rectangle on the dotted line indicates the life line of object
concerned (the time that object involved in computation)
Actors Objects
In a sequence diagram, objects and actors are aligned along the top of
the diagram. with a dotted line drawn vertically from these.
04/30/2020 CSE291 - Introduction to Software Engineering 7
The rectangle on the dotted line indicates the life line of object concerned
(Indicate when an object is performing an action)
04/30/2020 CSE291 - Introduction to Software Engineering 9
message
message
message
Sequence
Vertical position signifies sequence – earlier messages appear
nearer the top.
04/30/2020 CSE291 - Introduction to Software Engineering 11
Sequence Diagram
• Tracks a sequence of events in a scenario
• Identifies all objects involved
Objects
O1 O2 O3 O4 O5 indicates
that the
E1 event
E2 effects the
Events object
E3
E4
04/30/2020 CSE291 - Introduction to Software Engineering 13
E-mail Interface
04/30/2020 CSE291 - Introduction to Software Engineering 16
: user
04/30/2020 CSE291 - Introduction to Software Engineering 18
Add Objects
The first interaction is with the icon bar, which we can treat as an
Object
: icon bar
: user
04/30/2020 CSE291 - Introduction to Software Engineering 19
Add Message
The user talks to the icon bar
: icon bar
: user
04/30/2020 CSE291 - Introduction to Software Engineering 20
: user
click send mail
: user
click send mail create
Now the user can see the email page and use it.
04/30/2020 CSE291 - Introduction to Software Engineering 22
: user
click send mail create
fill in to box
fill in subject box
fill in contents box
04/30/2020 CSE291 - Introduction to Software Engineering 23
: user
click send mail create
fill in to box
fill in subject box
fill in contents box
send
04/30/2020 CSE291 - Introduction to Software Engineering 24
: user
click send mail create
fill in to box
fill in subject box
fill in contents box
send
look up email address
: user
click send mail create
fill in to box
fill in subject box
fill in contents box
send
look up email address
04/30/2020 CSE291 - Introduction to Software Engineering 26
: user
click send mail create
fill in to box
fill in subject box
fill in contents box
send
look up email address
submit email
04/30/2020 CSE291 - Introduction to Software Engineering 27
: user
click send mail create
fill in to box
fill in subject box
fill in contents box
send
look up email address
submit email
close
04/30/2020 CSE291 - Introduction to Software Engineering 28
: user
send mail( ) create
fill in to box
fill in subject box
fill in contents box
send
look up email address
submit email
close
04/30/2020 CSE291 - Introduction to Software Engineering 29
: user
send mail( ) create( )
enterTo( )
enterSubject( )
enterContents( )
send( )
getEmailAddress( )
submitEmail( )
close( )
04/30/2020 CSE291 - Introduction to Software Engineering 30
Exercise
Consider the following scenario and draw sequence diagram for
online book shop.
Sequence Fragment
Alternative Fragment
• The alternative fragment is used when a choice needs to be
made between two or more message sequences. It models
the “if then else” logic.
Option Fragment
• The option fragment is used to indicate a sequence that will
only occur under a certain condition, otherwise, the
sequence won’t occur. It models the “if then” statement.
Home Task
• Loop Fragment
• Reference fragment