UML多重性差异
多重性 *
和 0..*
之间有什么区别?
例如,同一关系的两个版本(A 和 B):
对于 Web 服务由任意数量的用户使用 的说法,哪一项更正确?
What is the difference between multiplicity *
and 0..*
?
For example two versions (A and B) of the same relationship:
What will be more correct for statement Web-service is used by any number of users?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然巴拉的答案是正确的,但我想补充一点,这不仅仅是风格问题。 UML 规范对于这个符号快捷方式是明确的:
因此,这两个图是等效的。此外,如果您明确使用 0..*,您可能也会使用 1..1:
While Bala's answer is correct, I'd like to add for the records that it's not just a question of style. The UML specifications are explicit about this notational shortcut:
So, both diagrams are equivalent. Moreover, if you're explicit with 0..*, you would probably do as well with 1..1:
它们是一体的;只是一个偏好问题。
x..y
样式特别适用于您已知的限制,通常不是 0 和 *,例如1..10
或5..*< /代码>
They are one and the same; just a matter of preference. The
x..y
style is particularly used with you have know limits, usually other than 0 and *, like1..10
or5..*