Review Topik Use-case Inside view dari sistem digambarkan dengan diagram interaksi 2
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
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
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
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
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
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
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 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).
Your consent to our cookies if you continue to use this website.