Difference between Sequence & Communication Diagram (UML) [closed]

情到浓时终转凉″ 提交于 2019-12-06 11:31:49

问题


What is the difference between sequence diagrams and communication (collaboration) diagrams in UML?


回答1:


Quoting Wikipedia:

Communication diagrams show a lot of the same information as sequence diagrams, but because of how the information is presented, some of it is easier to find in one diagram than the other. Communication diagrams show which elements each one interacts with better, but sequence diagrams show the order in which the interactions take place more clearly.

In essence, collaboration diagram emphasizes on which objects interacts with each other while sequence diagrams put more emphasis on the actual order. But they are actually equivalent, in exception to a little more details visible in sequence diagrams, like when and by whom the object was created/destroyed.




回答2:


Sequence diagram make it easier to follow the interactions since they are done from top to bottom, so finding message ordering is pretty simple. But if you have many object interacting, the diagram becomes hard to read.

Communication diagrams display what messages are passed between the objects with the sequence written on top of the message. For large amounts of objects, it is easier to understand than the sequence diagram, but message sequencing is harder to understand.




回答3:


In sequence diagram lifeline the element exists and potentially takes part in the interaction. In communication diagram lifeline represents an individual participant in the interaction.




回答4:


Sequence and communication diagrams show almost equivalent information, there respective strengths and weaknesses are:

Sequence diagrams:

Easy to see message ordering from object to object over time.

Communication diagrams:

Easy to see links, role names and the flow of traffic between a particular configuration of objects.



来源:https://stackoverflow.com/questions/10470813/difference-between-sequence-communication-diagram-uml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!