Interacion Diagram(交互图) = (Sequence Diagram)顺序图 + (Collaboration Diagram)协作图
Interaction Diagram is used to describe some type of interactions amongthe different elements in the model.
This interactive behavior is represented in UML by two diagrams known as Sequence Diagram and Collaboration Diagram.
- ★ Sequence Diagram emphasizes on time sequence of messages
- ★ Collaboration Diagram emphasizes on the structural organization of the objects
Purpose of Interaction Diagrams
The aim: Visualize the interactive behavior of the system.
Hence, the solution is to use different types of models to capture the different aspects of the interaction.
The purpose of interaction diagram is -
* To capture the **dynamic behavior** of a system
* To describe the **message flow** in the system
* To describe the **structural organization** of the objects
* To describe the **interaction** among objects
How to Draw an Interaction Diagram?
the purpose of interaction diagrams is to capture the dynamic aspect of a system.
We need to understand what a dynamic aspect is and how it is visualized.
- the time sequence of the message flow from one object to another =》 Sequence Diagram
- the organization of objects in a system taking part in the message now =》 Collaboration Diagram
Following things are to be identified clearly before drawing the interaction diagram
* Objects taking part in the interaction
* Message flows among the objects
* The sequence in which the messages are flowing.
* Object organization
The Sequence Diagram
the sequence diagram has four objects(Customer, Order, SpecialOrder and NormalOrder)
The Collaboration Diagram
it shows the object organization as seen in the following diagram.
In the collaboration diagram, the method call sequence is indicated by some numbering technique.