Docstoc

04 - Interaction Diagram

Document Sample
04 - Interaction Diagram Powered By Docstoc
					Interaction Diagram




                      1
                   Review
• Topik Use-case

• Inside view dari sistem digambarkan dengan
  diagram interaksi




                                               2
Sequence : How to Draw




                         3
         Sequence : How to Draw
• The light blue vertical rectangles show the
  objects activation.
• The green vertical rectangles represent when a
  particular object has control.
• The X represents when the object is destroyed.
• The condition is listed between brackets next to
  the message. For example, a [condition] has to be
  met before the object of class 2 can send a
  message() to the object of class 3.
                                                  4
Collaboration : How To Draw




                              5
                 Definition
• An interaction diagram shows an interaction,
  consisting of a set of objects and their
  relationships, including the messages that may
  be dispatched among them.
• You use interaction diagrams to model the
  dynamic aspects of a system.



                                               6
                 Definition
• Interaction diagrams model the behavior of use
  cases by describing the way groups of objects
  interact to complete the task.
• Interaction diagrams are used when you want to
  model the behavior of several objects in a use
  case. They demonstrate how the objects
  collaborate / communicate for the behavior.
• Collaborations are shown by lines between
  objects
• Messages are shown as labeled arrows, numbers
  show sequence
                                                   7
          Interaction Diagram
• A sequence diagram is an interaction diagram
  that emphasizes the time ordering of
  messages;
• A collaboration diagram is an interaction
  diagram that emphasizes the structural
  organization of the objects that send and
  receive messages.


                                                 8
           Sequence Diagram
• Sequence diagrams demonstrate the behavior
  of objects in a use case by describing the
  objects and the messages they pass.
• A Lifeline shows the time-ordered history of
  the interaction
• The diagrams are read left to right and
  descending.


                                                 9
        Collaboration Diagram
• They show the relationship between objects
  and the order of messages passed between
  them.
• The objects are listed as icons and arrows
  indicate the messages being passed between
  them.
• The numbers next to the messages are called
  sequence numbers.

                                                10
     Comparing and Contrasting:
Collaboration and Sequence diagrams
• Both diagrams show the same information
   –   Objects/classes
   –   Messages
   –   Sequence
   –   Conditional
   –   Repetition
   –   Messages to self
• Collaboration diagrams emphasize who-is-talking-to-who
   – But the time-ordering of the messages gets obscured
• Sequence diagrams emphasize time-ordering
   – But the who-is-talking-to-who gets obscured


                                                           11
          When to Use Interaction Diagrams
Menggunakan Diagram Interaksi
• Ketika mengetahui user requirements:
   – Identifikasi behavior beberapa objek dalam satu use case.
   – Gambarkan kolaborasi antar objek.
• Setelah identifikasi behavior objek selesai dengan diagram state dan
  aktivitas:
   – Periksa diagram state dan aktivitas, bandingkan dengan
      skenario.
Jangan Menggunakan Diagram Interaksi
• Untuk definisi persis dari sebuah kelas (gunakan diagram state).
• JIka ingin menggambarkan behavior antar banyak use case atau
  thread (guankan diagram aktivitas).


                                                                     12
Mapping to Code




                  13
Collaboration Diagram for
 Validate PIN Use Case:
       ATM Client


                            14
15
Sequence Diagram for
Validate PIN Use Case:
      ATM Client


                         16
17

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:39
posted:1/1/2011
language:Indonesian
pages:17