UML Diagrams: Can I use same actor on one diagram couple of times?

纵饮孤独 提交于 2019-12-31 02:45:07

问题


I am drawing some diagram, and I am wondering if it is acceptable for the actor to be in diagram more than once (for better transparency of the diagram)?

Thanks


回答1:


UMLDiagram is a composition of UMLDiagramElements, however Actor is NOT UmlDiagramElement, it is an Element. The UMLDiagramElement counterpart for Actor is either UMLShape (when shown as icon/figure) or UMLClassifierShape (when shown as a class box).

You have to keep the concepts of "UML Model" and "UML Diagram" separate. Model is a conceptual representation of your domain, and diagram is a concrete visual representation of a model.

The two elements from Model and Diagram are then connected by an association (B.2.2).

The association is N:M (and unidirectional), the model doesn't care that it is being visualized.

As far as I can tell there is nothing that would restrict you from having several visual representations of a single actor.

Lastly as both Thomas and Geert mentioned, it is a bad practice. If your diagram is so complex that you want multiple representations you should probably decompose it.




回答2:


Although UML does not forbid to use the same element more than once on a diagram, this is no good practice. Having the same UML element more than once on a diagram leads to confusion of the diagram reader. If you have the need to un-clutter connectors you probably already ran into a spider-web diagram style and you're better off to create several smaller diagrams.

Think of the implication: if any element appears more than once, then how would you know they are the same. This would lead to more confusion than it would actually help.



来源:https://stackoverflow.com/questions/34372262/uml-diagrams-can-i-use-same-actor-on-one-diagram-couple-of-times

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