多重性的 UML 语法是什么? (班级框内)

发布于 2024-08-17 13:06:01 字数 382 浏览 4 评论 0原文

我知道可以在同一类框中指定多重性,而不必绘制到另一个类的链接。

我的问题是,多重性应该放在哪里,在名称之后还是在类型之后?

是:

可见性名称多重性:类型

+ clients [0..n] : Client

还是

可见性名称:类型多重性

,因为

+ clients : Client [0..n]

我有两本书(Larman 的《Applitying UML and Patterns》和 UML 以及 Arlow 的《Unified process》和纽施塔特)但它们有所不同

I know it is possible to specify the multiplicity within the same class box, without having to draw the link to another class.

My question is, Where should the multiplicity go, after the name or after the type?

Is it:

visibility name multiplicity : type

as

+ clients [0..n] : Client

or

visibility name : type multiplicity

as

+ clients : Client [0..n]

I have two books (Applitying UML and Patterns by Larman and UML and the Unified process by Arlow and Newstadt ) but they differ

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧梦荧光笔 2024-08-24 13:06:01

摘自 UML 2.2 Superstruction OMG 规范

示例...

+createWindow(位置:坐标,容器:容器[0..1]):窗口

MORE 来自多重元素规范的示例,位于打印页 97。

规范中关于多重性的示例。

|--------------------------------------------|
|                Customer                    |
|--------------------------------------------|
| purchase : Purchase [*] {ordered, unique}  |
| account: Account [0..5] {unique}           |
|                                            |
|--------------------------------------------|

Pulled from printed page 107 of the UML 2.2 Superstructure OMG Specificiation

Example ...

+createWindow (location: Coordinates, container: Container [0..1]): Window

MORE Examples from the multiplicity element spec, on printed page 97.

Example from Spec on multiplicity.

|--------------------------------------------|
|                Customer                    |
|--------------------------------------------|
| purchase : Purchase [*] {ordered, unique}  |
| account: Account [0..5] {unique}           |
|                                            |
|--------------------------------------------|
醉南桥 2024-08-24 13:06:01

UML 语法是一种图解语法。 中的多重性示例

请参阅http://www.ibm 。 com/developerworks/rational/library/content/RationalEdge/sep04/bell/

图 6:Flight 类和 Plane 类之间双向关联的示例

 -----------------                   -----------------
 | Flight        |0..*         0..1  |  Plane        |
 |               | ------------------|               |
 |----------------                   -----------------

UML syntax is a diagrammatic syntax. See this multiplicity example from

http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/

Figure 6: An example of a bi-directional association between a Flight class and a Plane class

 -----------------                   -----------------
 | Flight        |0..*         0..1  |  Plane        |
 |               | ------------------|               |
 |----------------                   -----------------
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文