Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interaction Diagram 1. Review Topik Use-case Inside view dari sistem digambarkan dengan diagram interaksi 2.

Similar presentations


Presentation on theme: "Interaction Diagram 1. Review Topik Use-case Inside view dari sistem digambarkan dengan diagram interaksi 2."— Presentation transcript:

1 Interaction Diagram 1

2 Review Topik Use-case Inside view dari sistem digambarkan dengan diagram interaksi 2

3 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. 3

4 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 4

5 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. 5

6 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. 6

7 7 Sequence : How to Draw

8 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. 8

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. 9

10 10 Collaboration : How To Draw

11 Collaboration Diagram for Validate PIN Use Case: ATM Client 11

12 12

13 Sequence Diagram for Validate PIN Use Case: ATM Client 13

14 14

15 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 15

16 16 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).

17 Mapping to Code 17


Download ppt "Interaction Diagram 1. Review Topik Use-case Inside view dari sistem digambarkan dengan diagram interaksi 2."

Similar presentations


Ads by Google