SlideShare una empresa de Scribd logo
1 de 22
Sequence and Collaboration Diagrams

                                   Chapter 7




Object-Oriented Software Systems Engineering – Chapter 7   Slide 1
Objectives

 In this chapter we will:
  Review the different dynamic modelling
   techniques
  Discuss different types of messages
  Discuss different types of events
  Introduce sequence and collaboration diagrams




Object-Oriented Software Systems Engineering – Chapter 7   Slide 2
Dynamic Modelling

 Dynamics of a system
    how objects communicate and the effects of such
     communication
    how objects collaborate through communication and how
     objects change state
 Dynamics of a system is described by four diagrams
    State               Sequence
    Collaboration       Activity

 Interaction
    communication between objects in order to generate some
     function
    described in sequence, collaboration and activity diagrams



Object-Oriented Software Systems Engineering – Chapter 7   Slide 3
Dynamic Modelling diagrams

  State diagram -describes
       which states an object can have
       behaviour in those states
       what events cause the state to change


  Sequence diagram - describes how objects
    interact and communicate with each other
       primary focus is time
       shows how a sequence of messages are sent and
        received between a set of objects in order to perform
        some function


Object-Oriented Software Systems Engineering – Chapter 7    Slide 4
Dynamic Modelling diagrams

  Collaboration diagram - describes how objects
    interact
       focus is on space - relationships between objects are
        shown

  Activity diagram - describes activities and their
    order - another way of showing interactions
       focus on work - when objects interact they also perform
        work in terms of activities




Object-Oriented Software Systems Engineering – Chapter 7    Slide 5
Dynamic Modelling - Messages

  Message
     a communication between objects that conveys
      information
     has a sender and recipient
     is represented as an arrow denoting flow of control




Object-Oriented Software Systems Engineering – Chapter 7    Slide 6
Dynamic Modelling - Messages


    Types of messages
       simple
              flat flow of control - control is passed
                 without describing any details
          synchronous
              nested flow of control - operation call
              handling of the message is completed
                before the caller resumes execution
          asynchronous
              there is no explicit return to the caller
              the sender continues to execute after
                sending the message without waiting
                for it to be handled


Object-Oriented Software Systems Engineering – Chapter 7   Slide 7
Dynamic Modelling

  Use cases are elaborated in two stages
       Expand the use-cases into sequence diagrams
       Use the sequence diagrams to produce finite state
        machines




Object-Oriented Software Systems Engineering – Chapter 7    Slide 8
Events


  Kinds of events
     receipt of a call on an operation by another object
      ( message)
            the signal itself is an object-shown as an event-signature
              on state transitions
       receipt of an explicit signal from another object
        (message)
            the signal itself is an object- also shown as an event-
              signature on state transitions
       a condition becoming true
            shown as a guard condition
       passage of a designed period of time
            shown as a time expression


Object-Oriented Software Systems Engineering – Chapter 7               Slide 9
Events


  Basic semantics about event labeled transitions
     events are triggers that activate state transitions
     if an event can activate more then one transition only one
      will be triggered
     if en event occurs and guard is false then the event is
      ignored (events are not stored)




Object-Oriented Software Systems Engineering – Chapter 7   Slide 10
Dynamic Modelling-Sequence Diagram

                                       :Object A                  :Object B

                   :Actor A
                                                                                    Focus of control



                        Simple message


                           Synchronous
                             message               return


                                                                              Objects lifeline

                       Asynchronous
                         messge
                                                   destructor()




                       Object is destroyed   X

Object-Oriented Software Systems Engineering – Chapter 7                                               Slide 11
Sequence Diagram

                                             :A                   :B        :C

                                                  [ x>0 ] doM()




                                                  [ x<=0 doN()]
   Conditional branch




                                               :A                      :B



   Loop
                                                    *dialDigit(d)




Object-Oriented Software Systems Engineering – Chapter 7                         Slide 12
Sequence Diagram
   To support conditional and looping constructs, the UML
    uses frames. Frames are regions or fragments of the
    diagrams; they have an operator or label (such as loop) and
    a guard (conditional clause).
   The following table summarizes some common frame
    operators:

        Frame
     Operator                       Meaning
    alt       Alternative fragment for mutual exclusion
              conditional logic expressed in the guards.
    loop            Loop fragment while guard is true.
    opt             Optional fragment that executes if guard is true.
    par             Parallel fragments that execute in parallel.
    region          Critical region within which only one thread can run.

Object-Oriented Software Systems Engineering – Chapter 7            Slide 13
Sequence Diagram Example


                    :floor panel          :ElevatorControl     :floorSensor   :Elevator
                    <<boundary>>          <<control>>          <<boundary>>
  Person on floor
                             Call(floorNumber)

                                                                                          state idle


                                                       moveUp(floorNumber)

                                                 arriveAt(floorNumber)
                                                                                          state moving up
                                                           stop()




                                                                                           state idle




Object-Oriented Software Systems Engineering – Chapter 7                                  Slide 14
Sequence Diagram Example



                   :floor panel          :ElevatorControl     :floorSensor    :Elevator
                   <<boundary>>          <<control>>          <<boundary>>
 Person on floor
                            Call(floorNumber)

                                                                                           state idle


                                                      moveDown(floorNumber)

                                                arriveAt(floorNumber)
                                                                                          state moving down
                                                          stop()




                                                                                             state idle




Object-Oriented Software Systems Engineering – Chapter 7                                     Slide 15
Sequence Diagram Example

             :ElevatorControl       :floorSensor                :Elevator
             <<control>>            <<boundary>>

                                                                                   state idle
                        [timer=time_out]/moveDown(firstfloor)


                    arriveAt(firstfloor)
                                                                            state moving down to first floor

                                stop()




                                                                             state on first floor




Object-Oriented Software Systems Engineering – Chapter 7                                                       Slide 16
Dynamic Modelling - Collaboration Diagram


  Show:
     network of collaborating objects
       interactions
          - how messages are sent between objects
  Used to illustrate execution of
     a use case
     an operation
  Focus on time




Object-Oriented Software Systems Engineering – Chapter 7   Slide 17
Collaboration Diagram



                    : User
                                                                               : Queue



6: printing
                   1: print( file )



                          2: print( file)                   3: print( file )
          : Computer                        : Print                             : Printer
                                            Server
                             5: printing                     4: printing


 Object-Oriented Software Systems Engineering – Chapter 7                           Slide 18
Collaboration Diagram



  : User
                                                                      : Queue




                  1: print( file )           3: store( file )   4: stored
     6: wait

                         2: print( file)
         : Computer                        : Print                     : Printer
                                           Server
                             5: wait



Object-Oriented Software Systems Engineering – Chapter 7                     Slide 19
Collaboration Diagram for ElevatorControl

          On further investigation ElevatorControl may
           need to be expanded into more classes
          revisit sequence diagrams!

:ElevatorControl


1: Call floor(number)
                                     1.1: *[all queues]:len=length(){return shortest}               2: nextjob=get()
                                                                                        :Queue                         :Dispatcher
                        :Organiser
                                     1.3:Invoke(job){join queue}



                                      1.2:Create()
                                                                                        parameter


                                                                                                                        Active object
                                                                                                                        own thread
                                                                          :Order                                        of control




      Object-Oriented Software Systems Engineering – Chapter 7                                                         Slide 20
More about Interaction Diagrams

    Different developers have different preferences
       time-ordering or spatial
    Interaction diagrams are good at showing
     collaboration between objects
    They are not good at precise definition of the
     behaviour
    They are at their best when the behaviour is simple
    To capture complex behaviour in a single diagram
     use an activity diagram
    To look at the behaviour of a single object across
         many use cases use a state diagram
         many use cases or many threads use an activity diagram



Object-Oriented Software Systems Engineering – Chapter 7   Slide 21
Summary

 In this chapter we have:
  Reviewed the different dynamic modelling
   techniques
  Discussed different types of messages
  Discussed different types of events
  Introduced sequence and collaboration diagrams




Object-Oriented Software Systems Engineering – Chapter 7   Slide 22

Más contenido relacionado

La actualidad más candente

UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussion
CherryBerry2
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
Ashita Agrawal
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
mewaseem
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
naina-rani
 

La actualidad más candente (20)

Collaboration Diagram
Collaboration DiagramCollaboration Diagram
Collaboration Diagram
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
 
UML
UMLUML
UML
 
UML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussionUML Diagram @ Software engineering discussion
UML Diagram @ Software engineering discussion
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
11 deployment diagrams
11 deployment diagrams11 deployment diagrams
11 deployment diagrams
 
OOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMSOOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMS
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3
 
Unified modelling language (UML)
Unified modelling language (UML)Unified modelling language (UML)
Unified modelling language (UML)
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
Uml structural diagrams
Uml structural diagramsUml structural diagrams
Uml structural diagrams
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
 

Similar a 7. sequence and collaboration diagrams

5. state diagrams
5. state diagrams5. state diagrams
5. state diagrams
APU
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
APU
 
6. activity diagrams
6. activity diagrams6. activity diagrams
6. activity diagrams
APU
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral Diagrams
Dang Tuan
 
Shape12 6
Shape12 6Shape12 6
Shape12 6
pslulli
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
Steve Widom
 
Pertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramPertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagram
Abi Bobon
 
Introduction%20to%20 labview
Introduction%20to%20 labviewIntroduction%20to%20 labview
Introduction%20to%20 labview
andrearln
 

Similar a 7. sequence and collaboration diagrams (20)

5. state diagrams
5. state diagrams5. state diagrams
5. state diagrams
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
 
Lecture 07 virtual machine i
Lecture 07 virtual machine iLecture 07 virtual machine i
Lecture 07 virtual machine i
 
Uml
UmlUml
Uml
 
6. activity diagrams
6. activity diagrams6. activity diagrams
6. activity diagrams
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral Diagrams
 
Shape12 6
Shape12 6Shape12 6
Shape12 6
 
Implementation
ImplementationImplementation
Implementation
 
UML.pptx
UML.pptxUML.pptx
UML.pptx
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
Detecting aspect-specific code smells using Ekeko for AspectJ
Detecting aspect-specific code smells using Ekeko for AspectJDetecting aspect-specific code smells using Ekeko for AspectJ
Detecting aspect-specific code smells using Ekeko for AspectJ
 
Pertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagramPertemuan 6-2-sequence-diagram
Pertemuan 6-2-sequence-diagram
 
The Object-Oriented Approach to Requirements
The Object-Oriented Approach to RequirementsThe Object-Oriented Approach to Requirements
The Object-Oriented Approach to Requirements
 
Introduction%20to%20 labview
Introduction%20to%20 labviewIntroduction%20to%20 labview
Introduction%20to%20 labview
 
Jar chapter 4, part 1
Jar chapter 4, part 1Jar chapter 4, part 1
Jar chapter 4, part 1
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
[Codecamp 2016] Going functional with flyd and react
[Codecamp 2016] Going functional with flyd and react [Codecamp 2016] Going functional with flyd and react
[Codecamp 2016] Going functional with flyd and react
 
Jar chapter 4_part_ii
Jar chapter 4_part_iiJar chapter 4_part_ii
Jar chapter 4_part_ii
 

Más de APU

01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_module
APU
 
. 1. introduction to object orientation
. 1. introduction to object orientation. 1. introduction to object orientation
. 1. introduction to object orientation
APU
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_module
APU
 
9. oo languages
9. oo languages9. oo languages
9. oo languages
APU
 
8. design patterns
8. design patterns8. design patterns
8. design patterns
APU
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using uml
APU
 
3. use cases
3. use cases3. use cases
3. use cases
APU
 
01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_module
APU
 
. 9. oo languages
. 9. oo languages. 9. oo languages
. 9. oo languages
APU
 
08 aggregation and collection classes
08  aggregation and collection classes08  aggregation and collection classes
08 aggregation and collection classes
APU
 
. 8. design patterns
. 8. design patterns. 8. design patterns
. 8. design patterns
APU
 
. 5. state diagrams
. 5. state diagrams. 5. state diagrams
. 5. state diagrams
APU
 
. 4. class diagrams using uml
. 4. class diagrams using uml. 4. class diagrams using uml
. 4. class diagrams using uml
APU
 
. 2. introduction to uml
. 2. introduction to uml. 2. introduction to uml
. 2. introduction to uml
APU
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_module
APU
 
14 file handling
14 file handling14 file handling
14 file handling
APU
 
13 gui development
13 gui development13 gui development
13 gui development
APU
 
10 exceptionsin java
10 exceptionsin java10 exceptionsin java
10 exceptionsin java
APU
 
09 abstract classesandinterfaces
09 abstract classesandinterfaces09 abstract classesandinterfaces
09 abstract classesandinterfaces
APU
 
02 introductionto java
02 introductionto java02 introductionto java
02 introductionto java
APU
 

Más de APU (20)

01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_module
 
. 1. introduction to object orientation
. 1. introduction to object orientation. 1. introduction to object orientation
. 1. introduction to object orientation
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_module
 
9. oo languages
9. oo languages9. oo languages
9. oo languages
 
8. design patterns
8. design patterns8. design patterns
8. design patterns
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using uml
 
3. use cases
3. use cases3. use cases
3. use cases
 
01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_module
 
. 9. oo languages
. 9. oo languages. 9. oo languages
. 9. oo languages
 
08 aggregation and collection classes
08  aggregation and collection classes08  aggregation and collection classes
08 aggregation and collection classes
 
. 8. design patterns
. 8. design patterns. 8. design patterns
. 8. design patterns
 
. 5. state diagrams
. 5. state diagrams. 5. state diagrams
. 5. state diagrams
 
. 4. class diagrams using uml
. 4. class diagrams using uml. 4. class diagrams using uml
. 4. class diagrams using uml
 
. 2. introduction to uml
. 2. introduction to uml. 2. introduction to uml
. 2. introduction to uml
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_module
 
14 file handling
14 file handling14 file handling
14 file handling
 
13 gui development
13 gui development13 gui development
13 gui development
 
10 exceptionsin java
10 exceptionsin java10 exceptionsin java
10 exceptionsin java
 
09 abstract classesandinterfaces
09 abstract classesandinterfaces09 abstract classesandinterfaces
09 abstract classesandinterfaces
 
02 introductionto java
02 introductionto java02 introductionto java
02 introductionto java
 

7. sequence and collaboration diagrams

  • 1. Sequence and Collaboration Diagrams Chapter 7 Object-Oriented Software Systems Engineering – Chapter 7 Slide 1
  • 2. Objectives In this chapter we will:  Review the different dynamic modelling techniques  Discuss different types of messages  Discuss different types of events  Introduce sequence and collaboration diagrams Object-Oriented Software Systems Engineering – Chapter 7 Slide 2
  • 3. Dynamic Modelling  Dynamics of a system  how objects communicate and the effects of such communication  how objects collaborate through communication and how objects change state  Dynamics of a system is described by four diagrams State Sequence Collaboration Activity  Interaction  communication between objects in order to generate some function  described in sequence, collaboration and activity diagrams Object-Oriented Software Systems Engineering – Chapter 7 Slide 3
  • 4. Dynamic Modelling diagrams  State diagram -describes  which states an object can have  behaviour in those states  what events cause the state to change  Sequence diagram - describes how objects interact and communicate with each other  primary focus is time  shows how a sequence of messages are sent and received between a set of objects in order to perform some function Object-Oriented Software Systems Engineering – Chapter 7 Slide 4
  • 5. Dynamic Modelling diagrams  Collaboration diagram - describes how objects interact  focus is on space - relationships between objects are shown  Activity diagram - describes activities and their order - another way of showing interactions  focus on work - when objects interact they also perform work in terms of activities Object-Oriented Software Systems Engineering – Chapter 7 Slide 5
  • 6. Dynamic Modelling - Messages  Message  a communication between objects that conveys information  has a sender and recipient  is represented as an arrow denoting flow of control Object-Oriented Software Systems Engineering – Chapter 7 Slide 6
  • 7. Dynamic Modelling - Messages  Types of messages  simple flat flow of control - control is passed without describing any details  synchronous nested flow of control - operation call handling of the message is completed before the caller resumes execution  asynchronous there is no explicit return to the caller the sender continues to execute after sending the message without waiting for it to be handled Object-Oriented Software Systems Engineering – Chapter 7 Slide 7
  • 8. Dynamic Modelling  Use cases are elaborated in two stages  Expand the use-cases into sequence diagrams  Use the sequence diagrams to produce finite state machines Object-Oriented Software Systems Engineering – Chapter 7 Slide 8
  • 9. Events  Kinds of events  receipt of a call on an operation by another object ( message)  the signal itself is an object-shown as an event-signature on state transitions  receipt of an explicit signal from another object (message)  the signal itself is an object- also shown as an event- signature on state transitions  a condition becoming true  shown as a guard condition  passage of a designed period of time  shown as a time expression Object-Oriented Software Systems Engineering – Chapter 7 Slide 9
  • 10. Events  Basic semantics about event labeled transitions  events are triggers that activate state transitions  if an event can activate more then one transition only one will be triggered  if en event occurs and guard is false then the event is ignored (events are not stored) Object-Oriented Software Systems Engineering – Chapter 7 Slide 10
  • 11. Dynamic Modelling-Sequence Diagram :Object A :Object B :Actor A Focus of control Simple message Synchronous message return Objects lifeline Asynchronous messge destructor() Object is destroyed X Object-Oriented Software Systems Engineering – Chapter 7 Slide 11
  • 12. Sequence Diagram :A :B :C [ x>0 ] doM() [ x<=0 doN()]  Conditional branch :A :B  Loop *dialDigit(d) Object-Oriented Software Systems Engineering – Chapter 7 Slide 12
  • 13. Sequence Diagram  To support conditional and looping constructs, the UML uses frames. Frames are regions or fragments of the diagrams; they have an operator or label (such as loop) and a guard (conditional clause).  The following table summarizes some common frame operators: Frame Operator Meaning alt Alternative fragment for mutual exclusion conditional logic expressed in the guards. loop Loop fragment while guard is true. opt Optional fragment that executes if guard is true. par Parallel fragments that execute in parallel. region Critical region within which only one thread can run. Object-Oriented Software Systems Engineering – Chapter 7 Slide 13
  • 14. Sequence Diagram Example :floor panel :ElevatorControl :floorSensor :Elevator <<boundary>> <<control>> <<boundary>> Person on floor Call(floorNumber) state idle moveUp(floorNumber) arriveAt(floorNumber) state moving up stop() state idle Object-Oriented Software Systems Engineering – Chapter 7 Slide 14
  • 15. Sequence Diagram Example :floor panel :ElevatorControl :floorSensor :Elevator <<boundary>> <<control>> <<boundary>> Person on floor Call(floorNumber) state idle moveDown(floorNumber) arriveAt(floorNumber) state moving down stop() state idle Object-Oriented Software Systems Engineering – Chapter 7 Slide 15
  • 16. Sequence Diagram Example :ElevatorControl :floorSensor :Elevator <<control>> <<boundary>> state idle [timer=time_out]/moveDown(firstfloor) arriveAt(firstfloor) state moving down to first floor stop() state on first floor Object-Oriented Software Systems Engineering – Chapter 7 Slide 16
  • 17. Dynamic Modelling - Collaboration Diagram  Show:  network of collaborating objects  interactions - how messages are sent between objects  Used to illustrate execution of  a use case  an operation  Focus on time Object-Oriented Software Systems Engineering – Chapter 7 Slide 17
  • 18. Collaboration Diagram : User : Queue 6: printing 1: print( file ) 2: print( file) 3: print( file ) : Computer : Print : Printer Server 5: printing 4: printing Object-Oriented Software Systems Engineering – Chapter 7 Slide 18
  • 19. Collaboration Diagram : User : Queue 1: print( file ) 3: store( file ) 4: stored 6: wait 2: print( file) : Computer : Print : Printer Server 5: wait Object-Oriented Software Systems Engineering – Chapter 7 Slide 19
  • 20. Collaboration Diagram for ElevatorControl  On further investigation ElevatorControl may need to be expanded into more classes  revisit sequence diagrams! :ElevatorControl 1: Call floor(number) 1.1: *[all queues]:len=length(){return shortest} 2: nextjob=get() :Queue :Dispatcher :Organiser 1.3:Invoke(job){join queue} 1.2:Create() parameter Active object own thread :Order of control Object-Oriented Software Systems Engineering – Chapter 7 Slide 20
  • 21. More about Interaction Diagrams  Different developers have different preferences  time-ordering or spatial  Interaction diagrams are good at showing collaboration between objects  They are not good at precise definition of the behaviour  They are at their best when the behaviour is simple  To capture complex behaviour in a single diagram use an activity diagram  To look at the behaviour of a single object across  many use cases use a state diagram  many use cases or many threads use an activity diagram Object-Oriented Software Systems Engineering – Chapter 7 Slide 21
  • 22. Summary In this chapter we have:  Reviewed the different dynamic modelling techniques  Discussed different types of messages  Discussed different types of events  Introduced sequence and collaboration diagrams Object-Oriented Software Systems Engineering – Chapter 7 Slide 22

Notas del editor

  1. 1
  2. Interaction diagrams (two types) sequence and collaboration They show the passage of time for one scenario (you can show branching * iterations) You may have a primary sequence diagram and ones which show alternative paths and flows They are semantically equivalent. i.e. you can model the dynamica of a system using one type of diagram and transform it to another type with no loss of semantic meaning The reason for two types is that modelling dynamics is hard and often you need to approach it from different angles Sequence diagram emphasises the time ordering of the messages Collaboration diagram emphasises structural organisation of objects that sent and receive messages