类图中关联多重性的重要性是什么?
类图中关联多重性的重要性是什么? 我们为什么以及何时应该指出它们? 谢谢。
What is the importance of association multiplicity in class diagrams?
Why and when should we indicate them?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它们为设计师提供了一种快速的视觉沟通方式,如果没有多样性,这将是困难的。您必须在图表中使用注释或其他占用空间的注释。
在 UML 图中,我希望除一对一之外的所有其他关联都具有多重性。
为什么?
They allow the designer a quick visual way of communication that would be difficult without multiplicities. You would have to use notes or other space-eating annotations in the diagram.
In a UML diagram I want to have multiplicities for all other associations other than one-on-one.
Why?
它们更直接地传达业务规则。例如,一栋房子包含一个或多个房间。
They convey the business rules more directly. E.g an house contains one or more rooms.
UML 有多种用途。类图可以显示大量的内容。如果您试图详尽地记录系统的设计,那么您可能需要将它们全部展示出来。如果您试图解释设计的更具体的方面,则仅在相关时才显示它(即与该方面的设计/实现方式有关)。
UML gets used in many ways. There are a huge number of things a class diagram could show. If you're trying to exhaustively document a system's design then you may need to show them all. If you're trying to explain a more specific aspect of the design, only show it if it's relevant (i.e. has a bearing on how that aspect would be designed/implemented).