SlideShare una empresa de Scribd logo
1 de 26
OOAD
Sequence Diagrams
Interaction Diagrams

 Interaction diagrams describe exemplary
  how groups of objects collaborate in some
  behavior.
 An interaction diagram typically captures the
  behavior of a single use case.
 Interaction diagrams do not capture the
  complete behavior, only typical scenarios.
Types of Interaction Diagrams
  There are two types of interaction diagrams:
 Sequence diagrams emphasize the order or
  concurrency of the interactions.
 Collaboration diagrams emphasize the
  interacting objects.
Role of Interaction Diagrams in UML
Interaction Diagrams and Use Cases




   Behavior of the “order” use case:
   A customer orders several products.
   The (sub-)orders (“order lines”) for each product are prepared
   separately.
   For each product check the stock.
   • If the product is in stock, remove requested amount from stock.
   • If the product stock falls below a predefined level, reorder it.
Object
   Object naming:
                                                          myBirthdy
       syntax: [instanceName][:className]
                                                            :Date
       Name classes consistently with your class
        diagram (same classes).
       Include instance names when objects are
        referred to in messages or when several objects
        of the same type exist in the diagram.
   The Life-Line represents the object’s life
    during the interaction
Messages
 An  interaction between two objects is
  performed as a message sent from one
  object to another (simple operation call,
  Signaling, RPC)
 If object obj sends a message to another
               1
  object obj2 some link must exist between
  those two objects (dependency, same
  objects)
Messages (Cont.)
   A message is represented by an arrow between the
    life lines of two objects.
       Self calls are also allowed
       The time required by the receiver object to process the
        message is denoted by an activation-box.
   A message is labeled at minimum with the message
    name.
       Arguments and control information (conditions, iteration)
        may be included.
Return Values
 Optionally indicated using a dashed arrow
  with a label indicating the return value.
     Don’t model a return value when it is obvious
      what is being returned, e.g. getTotal()
     Model a return value only when you need to refer
      to it elsewhere, e.g. as a parameter passed in
      another message.
     Prefer modeling return values as part of a method
      invocation, e.g. ok = isValid()
Synchronous Messages
 Nestedflow of control, typically implemented
 as an operation call.
    The routine that handles the message is
     completed before the caller resumes execution.


                :A                       :B

                     doYouUnderstand()

                                                return
   Caller
                           yes                (optional)
  Blocked
Object Creation
 An
   object may create another object via a
 <<create>> message.

                                             Preferred
       :A                  :B   :A

            <<create>>               <<create>>
                                                  :B


             Constructor
Object Destruction
   An object may destroy another object via a
    <<destroy>> message.
       An object may destroy itself.
       Avoid modeling object destruction unless memory
        management is critical.


                                       :A             :B
                                            <<destroy>>
Sequence Model (1)
Sequence Model (2)
Sequence Model (3)
Sequence Model (4)
Why not just code it?
    Sequence diagrams can be somewhat close to the code
     level. So why not just code up that algorithm rather than
     drawing it as a sequence diagram?

    a good sequence diagram is still a bit above the level of the real code (not
     EVERY line of code is drawn on diagram)
    sequence diagrams are language-agnostic (can be implemented in many
     different languages
    non-coders can do sequence diagrams
    easier to do sequence diagrams as a team
    can see many objects/classes at a time on same page (visual bandwidth)



17
Lifetime of objects
 creation:  arrow with
  'new' written above it
      notice that an object
       created after the start of
       the scenario appears
       lower than the others

 deletion: an X at bottom
  of object's lifeline
      Java doesn't explicitly
       delete objects; they fall
       out of scope and are
       garbage-collected
  18
Indicating selection and loops
    frame: box around part of a sequence diagram
     to indicate selection or loop
        if -> (opt) [condition]
        if/else -> (alt) [condition], separated by horiz. dashed
         line
        loop -> (loop) [condition or opt [balance 0]
                                        items to loop over] [balance 100.00]
                                                 <>      alt       <



                                                                         [balance 100 ]
                                                                                >= .00




                                                    loop   [balance 0]
                                                                  <




19
Concurrent Processes and Activations
Concurrency in Sequence Diagrams (1)
Concurrency in Sequence Diagrams (2)
Concurrency in Sequence Diagrams (3)
A Successful Bank Transaction




 Reference: Object-Oriented Analysis and Design
 J.W. Schmidt, F. Matthes, TU Hamburg-Harburg
A Failing Bank Transaction




   Reference: Object-Oriented Analysis and Design
   J.W. Schmidt, F. Matthes, TU Hamburg-Harburg
Sequence diag. from use case




26

Más contenido relacionado

La actualidad más candente

Lecture11 use case sequence diagram
Lecture11 use case sequence diagramLecture11 use case sequence diagram
Lecture11 use case sequence diagramShahid Riaz
 
UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionCherryBerry2
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagramRamakant Soni
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagramRahul Pola
 
Activity diagram model
Activity diagram modelActivity diagram model
Activity diagram modelahmed zewita
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
Lecture6 activity diagrams
Lecture6 activity diagramsLecture6 activity diagrams
Lecture6 activity diagramsShahid Riaz
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelmohamed khalaf alla mohamedain
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity DiagramNiloy Rocker
 
SAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsSAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsMichael Heron
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction DiagramNiloy Rocker
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramAshesh R
 

La actualidad más candente (20)

UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 
Lecture11 use case sequence diagram
Lecture11 use case sequence diagramLecture11 use case sequence diagram
Lecture11 use case sequence diagram
 
UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussion
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Activity diagram model
Activity diagram modelActivity diagram model
Activity diagram model
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
Lecture6 activity diagrams
Lecture6 activity diagramsLecture6 activity diagrams
Lecture6 activity diagrams
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
Uml
UmlUml
Uml
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity Diagram
 
SAD11 - Sequence Diagrams
SAD11 - Sequence DiagramsSAD11 - Sequence Diagrams
SAD11 - Sequence Diagrams
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction Diagram
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 

Destacado

Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramNikhil Pandit
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 
الأستقبال في مصرف الدم Reception department ‫‬
الأستقبال في مصرف الدم Reception department ‫‬الأستقبال في مصرف الدم Reception department ‫‬
الأستقبال في مصرف الدم Reception department ‫‬Hayat abdulhamid
 
how to write your project documentation
how to write your project documentationhow to write your project documentation
how to write your project documentationMohannadaljboor
 
قسم التبرع بالدم ‫‬ blood donation department
قسم التبرع بالدم ‫‬  blood donation departmentقسم التبرع بالدم ‫‬  blood donation department
قسم التبرع بالدم ‫‬ blood donation departmentHayat abdulhamid
 
Blood donation ppt
Blood donation pptBlood donation ppt
Blood donation pptR prasad
 
Data Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence DiagramData Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence DiagramHamna Shahzad
 
Slide 5 Class Diagram
Slide 5 Class DiagramSlide 5 Class Diagram
Slide 5 Class DiagramNiloy Rocker
 
Blood Bank Management System
Blood Bank Management SystemBlood Bank Management System
Blood Bank Management SystemChirag N Jain
 
Activity diagram-UML diagram
Activity diagram-UML diagramActivity diagram-UML diagram
Activity diagram-UML diagramRamakant Soni
 
An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)Jubayer Al Mahmud
 
Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...
Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...
Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...Showrav Mazumder
 

Destacado (20)

Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence Diagram
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Practicing 2d drawing primitives
Practicing 2d drawing primitivesPracticing 2d drawing primitives
Practicing 2d drawing primitives
 
34. uml
34. uml34. uml
34. uml
 
Setting up your first open gl program
Setting up your first open gl programSetting up your first open gl program
Setting up your first open gl program
 
الأستقبال في مصرف الدم Reception department ‫‬
الأستقبال في مصرف الدم Reception department ‫‬الأستقبال في مصرف الدم Reception department ‫‬
الأستقبال في مصرف الدم Reception department ‫‬
 
how to write your project documentation
how to write your project documentationhow to write your project documentation
how to write your project documentation
 
Web 1.0, 2.0, 3.0
Web 1.0, 2.0, 3.0Web 1.0, 2.0, 3.0
Web 1.0, 2.0, 3.0
 
قسم التبرع بالدم ‫‬ blood donation department
قسم التبرع بالدم ‫‬  blood donation departmentقسم التبرع بالدم ‫‬  blood donation department
قسم التبرع بالدم ‫‬ blood donation department
 
Lecture07
Lecture07Lecture07
Lecture07
 
Blood bank
Blood bankBlood bank
Blood bank
 
Blood donation ppt
Blood donation pptBlood donation ppt
Blood donation ppt
 
Data Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence DiagramData Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence Diagram
 
Slide 5 Class Diagram
Slide 5 Class DiagramSlide 5 Class Diagram
Slide 5 Class Diagram
 
Blood Bank Management System
Blood Bank Management SystemBlood Bank Management System
Blood Bank Management System
 
Activity diagram-UML diagram
Activity diagram-UML diagramActivity diagram-UML diagram
Activity diagram-UML diagram
 
An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)An Online Car Parking System (Features & Diagrams Only)
An Online Car Parking System (Features & Diagrams Only)
 
Hotel management system
Hotel management systemHotel management system
Hotel management system
 
Windows and viewport
Windows and viewportWindows and viewport
Windows and viewport
 
Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...
Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...
Blood Bank Management Information System [Web-Url: http://infobloodbank.somee...
 

Similar a Ooad sequence diagram lecture

Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
 
Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Taymoor Nazmy
 
Introduction to OOA and UML - Part 2
Introduction to OOA and UML - Part 2 Introduction to OOA and UML - Part 2
Introduction to OOA and UML - Part 2 Shwetha-BA
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsAmr E. Mohamed
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III pkaviya
 
Pertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramPertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramAbi Bobon
 
Vizwik Coding Manual
Vizwik Coding ManualVizwik Coding Manual
Vizwik Coding ManualVizwik
 
06 ooad uml-07
06 ooad uml-0706 ooad uml-07
06 ooad uml-07Niit Care
 
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
 
Functional Programming With Scala
Functional Programming With ScalaFunctional Programming With Scala
Functional Programming With ScalaKnoldus Inc.
 
7. sequence and collaboration diagrams
7. sequence and collaboration diagrams7. sequence and collaboration diagrams
7. sequence and collaboration diagramsAPU
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side JavascriptJulie Iskander
 
Funtional Reactive Programming with Examples in Scala + GWT
Funtional Reactive Programming with Examples in Scala + GWTFuntional Reactive Programming with Examples in Scala + GWT
Funtional Reactive Programming with Examples in Scala + GWTVasil Remeniuk
 

Similar a Ooad sequence diagram lecture (20)

Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-
 
Introduction to OOA and UML - Part 2
Introduction to OOA and UML - Part 2 Introduction to OOA and UML - Part 2
Introduction to OOA and UML - Part 2
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
Visual basic bt0082
Visual basic  bt0082Visual basic  bt0082
Visual basic bt0082
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III
 
Pertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramPertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagram
 
Ood Post1
Ood Post1Ood Post1
Ood Post1
 
Vizwik Coding Manual
Vizwik Coding ManualVizwik Coding Manual
Vizwik Coding Manual
 
06 ooad uml-07
06 ooad uml-0706 ooad uml-07
06 ooad uml-07
 
Visual c sharp
Visual c sharpVisual c sharp
Visual c sharp
 
Cpprm
CpprmCpprm
Cpprm
 
UML and You
UML and YouUML and You
UML and You
 
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
 
Functional Programming With Scala
Functional Programming With ScalaFunctional Programming With Scala
Functional Programming With Scala
 
7. sequence and collaboration diagrams
7. sequence and collaboration diagrams7. sequence and collaboration diagrams
7. sequence and collaboration diagrams
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
Funtional Reactive Programming with Examples in Scala + GWT
Funtional Reactive Programming with Examples in Scala + GWTFuntional Reactive Programming with Examples in Scala + GWT
Funtional Reactive Programming with Examples in Scala + GWT
 
4. UML
4. UML4. UML
4. UML
 
UML.pptx
UML.pptxUML.pptx
UML.pptx
 

Último

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Último (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Ooad sequence diagram lecture

  • 2. Interaction Diagrams  Interaction diagrams describe exemplary how groups of objects collaborate in some behavior.  An interaction diagram typically captures the behavior of a single use case.  Interaction diagrams do not capture the complete behavior, only typical scenarios.
  • 3. Types of Interaction Diagrams There are two types of interaction diagrams:  Sequence diagrams emphasize the order or concurrency of the interactions.  Collaboration diagrams emphasize the interacting objects.
  • 4. Role of Interaction Diagrams in UML
  • 5. Interaction Diagrams and Use Cases Behavior of the “order” use case: A customer orders several products. The (sub-)orders (“order lines”) for each product are prepared separately. For each product check the stock. • If the product is in stock, remove requested amount from stock. • If the product stock falls below a predefined level, reorder it.
  • 6. Object  Object naming: myBirthdy  syntax: [instanceName][:className] :Date  Name classes consistently with your class diagram (same classes).  Include instance names when objects are referred to in messages or when several objects of the same type exist in the diagram.  The Life-Line represents the object’s life during the interaction
  • 7. Messages  An interaction between two objects is performed as a message sent from one object to another (simple operation call, Signaling, RPC)  If object obj sends a message to another 1 object obj2 some link must exist between those two objects (dependency, same objects)
  • 8. Messages (Cont.)  A message is represented by an arrow between the life lines of two objects.  Self calls are also allowed  The time required by the receiver object to process the message is denoted by an activation-box.  A message is labeled at minimum with the message name.  Arguments and control information (conditions, iteration) may be included.
  • 9. Return Values  Optionally indicated using a dashed arrow with a label indicating the return value.  Don’t model a return value when it is obvious what is being returned, e.g. getTotal()  Model a return value only when you need to refer to it elsewhere, e.g. as a parameter passed in another message.  Prefer modeling return values as part of a method invocation, e.g. ok = isValid()
  • 10. Synchronous Messages  Nestedflow of control, typically implemented as an operation call.  The routine that handles the message is completed before the caller resumes execution. :A :B doYouUnderstand() return Caller yes (optional) Blocked
  • 11. Object Creation  An object may create another object via a <<create>> message. Preferred :A :B :A <<create>> <<create>> :B Constructor
  • 12. Object Destruction  An object may destroy another object via a <<destroy>> message.  An object may destroy itself.  Avoid modeling object destruction unless memory management is critical. :A :B <<destroy>>
  • 17. Why not just code it?  Sequence diagrams can be somewhat close to the code level. So why not just code up that algorithm rather than drawing it as a sequence diagram?  a good sequence diagram is still a bit above the level of the real code (not EVERY line of code is drawn on diagram)  sequence diagrams are language-agnostic (can be implemented in many different languages  non-coders can do sequence diagrams  easier to do sequence diagrams as a team  can see many objects/classes at a time on same page (visual bandwidth) 17
  • 18. Lifetime of objects  creation: arrow with 'new' written above it  notice that an object created after the start of the scenario appears lower than the others  deletion: an X at bottom of object's lifeline  Java doesn't explicitly delete objects; they fall out of scope and are garbage-collected 18
  • 19. Indicating selection and loops  frame: box around part of a sequence diagram to indicate selection or loop  if -> (opt) [condition]  if/else -> (alt) [condition], separated by horiz. dashed line  loop -> (loop) [condition or opt [balance 0] items to loop over] [balance 100.00] <> alt < [balance 100 ] >= .00 loop [balance 0] < 19
  • 21. Concurrency in Sequence Diagrams (1)
  • 22. Concurrency in Sequence Diagrams (2)
  • 23. Concurrency in Sequence Diagrams (3)
  • 24. A Successful Bank Transaction Reference: Object-Oriented Analysis and Design J.W. Schmidt, F. Matthes, TU Hamburg-Harburg
  • 25. A Failing Bank Transaction Reference: Object-Oriented Analysis and Design J.W. Schmidt, F. Matthes, TU Hamburg-Harburg
  • 26. Sequence diag. from use case 26