SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussion
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Activity diagrams
Activity diagramsActivity diagrams
Activity diagrams
 
Functional modeling
Functional modelingFunctional modeling
Functional modeling
 
Object diagram
Object diagramObject diagram
Object diagram
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagram
 
Uml activity diagram
Uml activity diagramUml activity diagram
Uml activity diagram
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity Diagram
 
UML
UMLUML
UML
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
The Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram TutorialThe Ultimate Sequence Diagram Tutorial
The Ultimate Sequence Diagram Tutorial
 
Lecture04- Use Case Diagrams
Lecture04- Use Case DiagramsLecture04- Use Case Diagrams
Lecture04- Use Case Diagrams
 
Web controls
Web controlsWeb controls
Web controls
 
Object diagram
Object diagramObject diagram
Object diagram
 
OOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMSOOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMS
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Sequence diagrame
Sequence diagrameSequence diagrame
Sequence diagrame
 

Andere mochten auch

Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagramRamakant Soni
 
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
 

Andere mochten auch (20)

Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 

Kürzlich hochgeladen (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

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