SlideShare a Scribd company logo
1 of 22
+
Sequence Diagrams
Systems Analysis and Design
Michael Heron
+
Introduction
 We’ve got a lot of tools available to us now to outline parts of a
system.
 The Class Diagram shows us the classes, their relationships, and
the interfaces
 The Use Case Diagram shows us the set of interactions the user
may have with the system.
 The Activity Diagram shows us the underlying logical structure of
activities the user may perform.
 We need though something that allows us to stitch these
together.
 Something that shows us what happens when a user interacts with
our system – what methods are called in what order and with what
information.
+
The Sequence Diagram
 The sequence diagram is the one that does this.
 It ties together processes, activities and object interactions.
 It shows the names of objects, the classes to which they belong,
and the behaviours we’re going to access.
 They are, syntactically, one of the most complicated kind of
UML document.
 It is important to remember that they serve as a ‘refinement’ of other
information elsewhere in your model.
 We use sequence diagrams to define logically the interactions
that a user may have with our system.
 Essentially they are the bit that takes over when someone makes
use of a use-case.
+
A Simple Class Diagram
+
The Use Case – Find A Book
 When a user triggers the Find a Book use case, our sequence
diagram takes over.
 It highlights the objects that we’re going to use, and what classes
they are of.
 It handles parameters, and method calls.
 It shows persistance of methods.
 It shows what gets returned from each part of the system.
 What it doesn’t show is the underlying activity.
 We already have diagrams that handle that part of the process.
 In this case, an object (Us – implemented in this example as an
Organization) asks the library for the book we want.
+
Get Book (ISBN: String)
+
The Lifeline
 One of the key elements of a sequence diagram is the lifeline.
 That’s the box which contains the descriptive label, and the dotted line that descends from it.
 The lifeline represents roles or objects that participate in the sequence being modelled.
 The objects themselves are of secondary importance, only used to show how messages.
 In the box, we use the standard UML naming convention – name of the object and the
name of the class.
 A Library object called ourLibrary, for example.
 Not all lifelines represent named objects. Sometimes they are anonymous or temporary
instances.
 In such cases, we leave the name blank.
 The long thick bars on the lifelines represent persistence.
 The longer they are there, the longer the object must be held in memory.
+
Messages
 Messages are indicated by arrows detailing the message being
sent, and the parameters that go along with it.
 We call them messages, but they are actually method invocations.
 The first message is placed at the top left of the diagram, and
represents the triggering method call.
 This is the very first method that comes into the very first lifeline.
 Each subsequent message is drawn slightly lower down on the
diagram.
 The message indicates a method that is going to be called on
the lifeline to which it points.
+
Messages
 The diagram also shows return messages.
 Returned variables, essentially.
 These are drawn as dotted lines with an open
ended arrow.
 Return messages, strictly speaking, are optional.
 We must always send a message to interact with an
object, but we don’t always get anything back.
 Some messages may also be self referential
 They point in to themselves. They represent either
internal method calls or recursion.
DoSomethingFunky
+
A Second Diagram
+
The Guard
 This second diagram shows an extra element of sequence
notation – the guard.
 This is a conditional expression placed on the transmission of a
message.
 If the condition is not met, then the message will not be transmitted.
 In our diagram, we don’t ask for the title unless we actually
have a book to call the method on.
 Guards must be easily possible to evaluate to true or false
within the context of the diagram.
+
Alternates
 Guards offer a way to place conditions on the sending of a
message, but the usual reality is more complicated.
 If the condition isn’t met, we need to follow an alternate path of
execution.
 To handle this, we use alternates – a ‘box out’ sequence
diagram (known as a frame). This allow us to represent if, if-
else, if-else-if and more complex multiple options.
 Let’s look at a new scenario for this – a bank attempting to
withdraw money from someone’s account.
 If they have it, we give them the money. If they don’t, we give them
the money and then fine them for an unauthorized overdraft.
+
Alternates - Without
+
Alternates - With
+
Alternates
 Alternates represent an either or set of possibilities.
 An if-else
 We can also implement pure ‘if’ relationships by using an OPT
frame.
 This hangs off of the diagram in the same way as an ALT frame.
 Going back to our library example, let’s look at an example of
the user getting a book.
 If it’s there, get the book.
 If the book doesn’t exist, we will instead do an interlibrary loan
request to get it.
+
OPT Frames
+
Other Sequence Diagram
Conventions
 When an object is removed from memory, the convention is to
draw an X under it.
 This indicates the object is destroyed.
 Loops can be indicated within an activity diagram using a
separate LOOP frame.
 As with ALT and OPT.
 Use-case diagrams can be physically represented into an
activity diagram.
 Include the actor in the diagram to show which use case to which
the sequence represents.
+
Example of Other Conventions
http://www.agilemodeling.com/artifacts/sequenceDiagram.htm
+
Assessment
 Sequence diagrams are not required in your assessment
submission.
 Or rather, not explicitly required.
 However, consider how you will test whether or not the various
parts of your system mesh up.
 Short of fully coding it, it’s hard to tell whether they will.
 Activity diagrams give you a way to actually determine whether
or not your design will yield a workable system.
 Do you have access to the methods you need?
 Can they be called in a sensible order?
 Do they return the things you need them to return?
+
Benefits and Drawbacks of
Sequence Diagrams
 There are many benefits to using these kinds of diagram.
 They neatly tie together many other diagrams.
 They give you a way to see the ‘big picture’ of interaction between
objects and classes.
 They allow you to easily represent optional sequences, loops and
alternative courses of actions.
 However…
 You’re using a lot of diagrams now. Without some proper diagram
software that links it all together, a change in one is difficult to make
in all.
 Nonetheless I would recommend using these to link your
testing world to your design.
+
Testing your Design
 Think of sequence diagrams as an ‘implied’ optional requirement.
 You have to test your design, and this is the easiest way to do it.
 What a sequence diagram will neatly do is identify flaws in how
you have things set up.
 When you make a method call, determine if the object you are calling it
on is in scope.
 Determine if it has the appropriate level of visibility.
 Determine if you can get access to it at all.
 They let you explore the ramifications of your static model at a
conceptual level.
 They let you explore the classes and associations that are implied
by use-case relationships.
+
Conclusion
 Sequence diagrams are a powerful tool for stitching together
various diagrams.
 And as a result, they give you an opportunity to explore the
connections between all the various elements.
 They are powerful and offer opportunities for incorporating
more complex flows of execution than many other kinds of
diagrams.
 Through the use of OPT, LOOP and ALT frames.
 While not required for your assessment, they represent your
easiest course of action in terms of validating the design
decisions that you are making.

More Related Content

What's hot

Communication diagram Introduction
Communication diagram IntroductionCommunication diagram Introduction
Communication diagram IntroductionDineesha Suraweera
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagramRamakant Soni
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software EngineeringManish Kumar
 
10 component diagram
10 component diagram10 component diagram
10 component diagramBaskarkncet
 
Architectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdArchitectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdjayashri kolekar
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Ramakant Soni
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbolsKumar
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-designOliver Cheng
 
Uml deployment diagram
Uml deployment diagramUml deployment diagram
Uml deployment diagramAsraa Batool
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Object oriented modeling and design
Object oriented modeling and designObject oriented modeling and design
Object oriented modeling and designjayashri kolekar
 

What's hot (20)

Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Communication diagram Introduction
Communication diagram IntroductionCommunication diagram Introduction
Communication diagram Introduction
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software Engineering
 
10 component diagram
10 component diagram10 component diagram
10 component diagram
 
Unified process Model
Unified process ModelUnified process Model
Unified process Model
 
Architectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omdArchitectural modeling chapter 5 of omd
Architectural modeling chapter 5 of omd
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram
 
Uml Common Mechanism
Uml Common MechanismUml Common Mechanism
Uml Common Mechanism
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbols
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Ooad
OoadOoad
Ooad
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-design
 
Uml deployment diagram
Uml deployment diagramUml deployment diagram
Uml deployment diagram
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Sequence diagrame
Sequence diagrameSequence diagrame
Sequence diagrame
 
Object oriented modeling and design
Object oriented modeling and designObject oriented modeling and design
Object oriented modeling and design
 

Viewers also liked

Tugas Ii Adbo Uml Diagram
Tugas Ii Adbo   Uml DiagramTugas Ii Adbo   Uml Diagram
Tugas Ii Adbo Uml Diagramguestcc2db590
 
Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramNikhil Pandit
 
Modeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsModeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsMustafa Isik
 
SEM - UML (1st case study)
SEM - UML (1st case study)SEM - UML (1st case study)
SEM - UML (1st case study)vinay arora
 
Unit three identifying actors
Unit three  identifying actorsUnit three  identifying actors
Unit three identifying actorsgopal10scs185
 
Taxi Booking System UML - Sequence Diagram
Taxi Booking System UML - Sequence DiagramTaxi Booking System UML - Sequence Diagram
Taxi Booking System UML - Sequence DiagramTyler Mooney
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagramweichen
 
Library Management System
Library Management SystemLibrary Management System
Library Management SystemAnit Thapaliya
 
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...Ivano Malavolta
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramAshesh R
 

Viewers also liked (16)

Tugas Ii Adbo Uml Diagram
Tugas Ii Adbo   Uml DiagramTugas Ii Adbo   Uml Diagram
Tugas Ii Adbo Uml Diagram
 
Uml sequence diagrams
Uml sequence diagramsUml sequence diagrams
Uml sequence diagrams
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence Diagram
 
Sequence diagrams in UML
Sequence diagrams in UMLSequence diagrams in UML
Sequence diagrams in UML
 
Modeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsModeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence Diagrams
 
SEM - UML (1st case study)
SEM - UML (1st case study)SEM - UML (1st case study)
SEM - UML (1st case study)
 
Ultimate company
Ultimate companyUltimate company
Ultimate company
 
Unit three identifying actors
Unit three  identifying actorsUnit three  identifying actors
Unit three identifying actors
 
Taxi Booking System UML - Sequence Diagram
Taxi Booking System UML - Sequence DiagramTaxi Booking System UML - Sequence Diagram
Taxi Booking System UML - Sequence Diagram
 
Case Study Uml
Case Study UmlCase Study Uml
Case Study Uml
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagram
 
Library Management System
Library Management SystemLibrary Management System
Library Management System
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...Modeling objects interaction via UML sequence diagrams  [Software Modeling] [...
Modeling objects interaction via UML sequence diagrams [Software Modeling] [...
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 

Similar to SAD11 - Sequence Diagrams

UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software EngineeringAmit Singh
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 
Lecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASELecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASEbabak danyal
 
Intro to UML 2
Intro to UML 2Intro to UML 2
Intro to UML 2rchakra
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2Sisir Ghosh
 
SAD09 - Activity Diagrams
SAD09 - Activity DiagramsSAD09 - Activity Diagrams
SAD09 - Activity DiagramsMichael Heron
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5dmhall
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5dmhall
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5dmhall
 
ITP251 SWL 5
ITP251 SWL 5ITP251 SWL 5
ITP251 SWL 5dmhall
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5dmhall
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5dmhall
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software EngineeringAmit Singh
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagramSadhana28
 
Basic Behavioral Modeling
Basic Behavioral ModelingBasic Behavioral Modeling
Basic Behavioral ModelingAMITJain879
 
Uml with detail
Uml with detailUml with detail
Uml with detailHamza Khan
 
SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object OrientationMichael Heron
 
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNOOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNKalyaniLokhande5
 
Object diagram
Object diagramObject diagram
Object diagramRahul Pola
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Languagesurana college
 

Similar to SAD11 - Sequence Diagrams (20)

UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
Lecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASELecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASE
 
Intro to UML 2
Intro to UML 2Intro to UML 2
Intro to UML 2
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2
 
SAD09 - Activity Diagrams
SAD09 - Activity DiagramsSAD09 - Activity Diagrams
SAD09 - Activity Diagrams
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5
 
ITP251 SWL 5
ITP251 SWL 5ITP251 SWL 5
ITP251 SWL 5
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagram
 
Basic Behavioral Modeling
Basic Behavioral ModelingBasic Behavioral Modeling
Basic Behavioral Modeling
 
Uml with detail
Uml with detailUml with detail
Uml with detail
 
SAD02 - Object Orientation
SAD02 - Object OrientationSAD02 - Object Orientation
SAD02 - Object Orientation
 
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNOOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
 
Object diagram
Object diagramObject diagram
Object diagram
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 

More from Michael Heron

Meeple centred design - Board Game Accessibility
Meeple centred design - Board Game AccessibilityMeeple centred design - Board Game Accessibility
Meeple centred design - Board Game AccessibilityMichael Heron
 
Musings on misconduct
Musings on misconductMusings on misconduct
Musings on misconductMichael Heron
 
Accessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS FrameworkAccessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS FrameworkMichael Heron
 
ACCESS: A Technical Framework for Adaptive Accessibility Support
ACCESS:  A Technical Framework for Adaptive Accessibility SupportACCESS:  A Technical Framework for Adaptive Accessibility Support
ACCESS: A Technical Framework for Adaptive Accessibility SupportMichael Heron
 
Authorship and Autership
Authorship and AutershipAuthorship and Autership
Authorship and AutershipMichael Heron
 
Text parser based interaction
Text parser based interactionText parser based interaction
Text parser based interactionMichael Heron
 
GRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityGRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityMichael Heron
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - TexturesMichael Heron
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)Michael Heron
 
GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)Michael Heron
 
GRPHICS03 - Graphical Representation
GRPHICS03 - Graphical RepresentationGRPHICS03 - Graphical Representation
GRPHICS03 - Graphical RepresentationMichael Heron
 
GRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D GraphicsGRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D GraphicsMichael Heron
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsMichael Heron
 
GRPHICS09 - Art Appreciation
GRPHICS09 - Art AppreciationGRPHICS09 - Art Appreciation
GRPHICS09 - Art AppreciationMichael Heron
 

More from Michael Heron (20)

Meeple centred design - Board Game Accessibility
Meeple centred design - Board Game AccessibilityMeeple centred design - Board Game Accessibility
Meeple centred design - Board Game Accessibility
 
Musings on misconduct
Musings on misconductMusings on misconduct
Musings on misconduct
 
Accessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS FrameworkAccessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS Framework
 
ACCESS: A Technical Framework for Adaptive Accessibility Support
ACCESS:  A Technical Framework for Adaptive Accessibility SupportACCESS:  A Technical Framework for Adaptive Accessibility Support
ACCESS: A Technical Framework for Adaptive Accessibility Support
 
Authorship and Autership
Authorship and AutershipAuthorship and Autership
Authorship and Autership
 
Text parser based interaction
Text parser based interactionText parser based interaction
Text parser based interaction
 
SAD04 - Inheritance
SAD04 - InheritanceSAD04 - Inheritance
SAD04 - Inheritance
 
GRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityGRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and Radiosity
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - Textures
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)
 
GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)
 
GRPHICS03 - Graphical Representation
GRPHICS03 - Graphical RepresentationGRPHICS03 - Graphical Representation
GRPHICS03 - Graphical Representation
 
GRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D GraphicsGRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D Graphics
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
 
GRPHICS09 - Art Appreciation
GRPHICS09 - Art AppreciationGRPHICS09 - Art Appreciation
GRPHICS09 - Art Appreciation
 
2CPP18 - Modifiers
2CPP18 - Modifiers2CPP18 - Modifiers
2CPP18 - Modifiers
 
2CPP17 - File IO
2CPP17 - File IO2CPP17 - File IO
2CPP17 - File IO
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
2CPP15 - Templates
2CPP15 - Templates2CPP15 - Templates
2CPP15 - Templates
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

SAD11 - Sequence Diagrams

  • 1. + Sequence Diagrams Systems Analysis and Design Michael Heron
  • 2. + Introduction  We’ve got a lot of tools available to us now to outline parts of a system.  The Class Diagram shows us the classes, their relationships, and the interfaces  The Use Case Diagram shows us the set of interactions the user may have with the system.  The Activity Diagram shows us the underlying logical structure of activities the user may perform.  We need though something that allows us to stitch these together.  Something that shows us what happens when a user interacts with our system – what methods are called in what order and with what information.
  • 3. + The Sequence Diagram  The sequence diagram is the one that does this.  It ties together processes, activities and object interactions.  It shows the names of objects, the classes to which they belong, and the behaviours we’re going to access.  They are, syntactically, one of the most complicated kind of UML document.  It is important to remember that they serve as a ‘refinement’ of other information elsewhere in your model.  We use sequence diagrams to define logically the interactions that a user may have with our system.  Essentially they are the bit that takes over when someone makes use of a use-case.
  • 5. + The Use Case – Find A Book  When a user triggers the Find a Book use case, our sequence diagram takes over.  It highlights the objects that we’re going to use, and what classes they are of.  It handles parameters, and method calls.  It shows persistance of methods.  It shows what gets returned from each part of the system.  What it doesn’t show is the underlying activity.  We already have diagrams that handle that part of the process.  In this case, an object (Us – implemented in this example as an Organization) asks the library for the book we want.
  • 7. + The Lifeline  One of the key elements of a sequence diagram is the lifeline.  That’s the box which contains the descriptive label, and the dotted line that descends from it.  The lifeline represents roles or objects that participate in the sequence being modelled.  The objects themselves are of secondary importance, only used to show how messages.  In the box, we use the standard UML naming convention – name of the object and the name of the class.  A Library object called ourLibrary, for example.  Not all lifelines represent named objects. Sometimes they are anonymous or temporary instances.  In such cases, we leave the name blank.  The long thick bars on the lifelines represent persistence.  The longer they are there, the longer the object must be held in memory.
  • 8. + Messages  Messages are indicated by arrows detailing the message being sent, and the parameters that go along with it.  We call them messages, but they are actually method invocations.  The first message is placed at the top left of the diagram, and represents the triggering method call.  This is the very first method that comes into the very first lifeline.  Each subsequent message is drawn slightly lower down on the diagram.  The message indicates a method that is going to be called on the lifeline to which it points.
  • 9. + Messages  The diagram also shows return messages.  Returned variables, essentially.  These are drawn as dotted lines with an open ended arrow.  Return messages, strictly speaking, are optional.  We must always send a message to interact with an object, but we don’t always get anything back.  Some messages may also be self referential  They point in to themselves. They represent either internal method calls or recursion. DoSomethingFunky
  • 11. + The Guard  This second diagram shows an extra element of sequence notation – the guard.  This is a conditional expression placed on the transmission of a message.  If the condition is not met, then the message will not be transmitted.  In our diagram, we don’t ask for the title unless we actually have a book to call the method on.  Guards must be easily possible to evaluate to true or false within the context of the diagram.
  • 12. + Alternates  Guards offer a way to place conditions on the sending of a message, but the usual reality is more complicated.  If the condition isn’t met, we need to follow an alternate path of execution.  To handle this, we use alternates – a ‘box out’ sequence diagram (known as a frame). This allow us to represent if, if- else, if-else-if and more complex multiple options.  Let’s look at a new scenario for this – a bank attempting to withdraw money from someone’s account.  If they have it, we give them the money. If they don’t, we give them the money and then fine them for an unauthorized overdraft.
  • 15. + Alternates  Alternates represent an either or set of possibilities.  An if-else  We can also implement pure ‘if’ relationships by using an OPT frame.  This hangs off of the diagram in the same way as an ALT frame.  Going back to our library example, let’s look at an example of the user getting a book.  If it’s there, get the book.  If the book doesn’t exist, we will instead do an interlibrary loan request to get it.
  • 17. + Other Sequence Diagram Conventions  When an object is removed from memory, the convention is to draw an X under it.  This indicates the object is destroyed.  Loops can be indicated within an activity diagram using a separate LOOP frame.  As with ALT and OPT.  Use-case diagrams can be physically represented into an activity diagram.  Include the actor in the diagram to show which use case to which the sequence represents.
  • 18. + Example of Other Conventions http://www.agilemodeling.com/artifacts/sequenceDiagram.htm
  • 19. + Assessment  Sequence diagrams are not required in your assessment submission.  Or rather, not explicitly required.  However, consider how you will test whether or not the various parts of your system mesh up.  Short of fully coding it, it’s hard to tell whether they will.  Activity diagrams give you a way to actually determine whether or not your design will yield a workable system.  Do you have access to the methods you need?  Can they be called in a sensible order?  Do they return the things you need them to return?
  • 20. + Benefits and Drawbacks of Sequence Diagrams  There are many benefits to using these kinds of diagram.  They neatly tie together many other diagrams.  They give you a way to see the ‘big picture’ of interaction between objects and classes.  They allow you to easily represent optional sequences, loops and alternative courses of actions.  However…  You’re using a lot of diagrams now. Without some proper diagram software that links it all together, a change in one is difficult to make in all.  Nonetheless I would recommend using these to link your testing world to your design.
  • 21. + Testing your Design  Think of sequence diagrams as an ‘implied’ optional requirement.  You have to test your design, and this is the easiest way to do it.  What a sequence diagram will neatly do is identify flaws in how you have things set up.  When you make a method call, determine if the object you are calling it on is in scope.  Determine if it has the appropriate level of visibility.  Determine if you can get access to it at all.  They let you explore the ramifications of your static model at a conceptual level.  They let you explore the classes and associations that are implied by use-case relationships.
  • 22. + Conclusion  Sequence diagrams are a powerful tool for stitching together various diagrams.  And as a result, they give you an opportunity to explore the connections between all the various elements.  They are powerful and offer opportunities for incorporating more complex flows of execution than many other kinds of diagrams.  Through the use of OPT, LOOP and ALT frames.  While not required for your assessment, they represent your easiest course of action in terms of validating the design decisions that you are making.