开发者

UML multiplicity difference

What is the difference between multiplicity * and 0..*?

For example two versions (A and B) of the same relationship:

UML multiplicity difference

What will be more correct for statement Web-service is used by any number of users开发者_开发技巧?


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:

UML 2.5.1, p.35: If the lower bound is equal to the upper bound, then an alternate notation is to use a string containing just the upper bound. For example, “1” is semantically equivalent to “1..1” multiplicity. A multiplicity with zero as the lower bound and an unspecified upper bound may use the alternative notation containing a single star “ * ” instead of “0..*” multiplicity.

So, both diagrams are equivalent. Moreover, if you're explicit with 0..*, you would probably do as well with 1..1:

UML multiplicity difference


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 *, like 1..10 or 5..*

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜