如何在ArgoUML中绘制属性和类之间的关系?

发布于 2024-11-08 19:59:19 字数 490 浏览 5 评论 0原文

在 ArgoUML 中,我能够将类 Type 放入类的任何属性中。例如,我可以在 Order 类中声明一个具有 Customer 类型的 customer 属性。 我还可以轻松地绘制类与类之间的关系:

类图

但我不知道如何“绘制”从 customer 属性到 Customer 类的链接。该链接从未真正连接到属性,而是连接到整个 Order 类。

我可以手动移动链接的位置:

在此处输入图像描述

但它从来没有真正“锁定”到 客户财产,并且可以由软件随时自动移动。

有办法做到这一点吗?

In ArgoUML, I have the ability to put a class Type to any property of a class. For example, I can declare a customer property with a Customer type in the Order class.
I can also easily draw a relationship from class to class:

Class diagram

But I can't figure out how to "draw" the link from the customer property to the Customer class. The link is never really connected to the property, but rather to the entire Order class.

I can move the position of the link manually:

enter image description here

But it's never really "locked" to the customer property, and can be moved automatically by the software at any moment.

Is there a way to do this?

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

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

发布评论

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

评论(3

天气好吗我好吗 2024-11-15 19:59:19

您不能在 UML 中建立未连接整个两个类的关联。无法触及类内的属性。
解决方法是:

  • 添加链接到该属性的注释,
  • 向该属性添加一个图标,该图标的设计类似于关联。

我不知道这个高级图标定制是否可以在这个免费工具中使用,但它可以在其他工具中使用。

You can not have an association in UML which is not connecting the entire two classes. It is not possible to touch the property inside the class.
Workarounds are:

  • add a note linked to the property
  • add an icon to the property which would be designed like an association.

I don't know if this advanced icons customization is available in this free tool but it is in other tools.

故事和酒 2024-11-15 19:59:19

我找到了一个 Flash 演示,它显示了带有图标的关联属性。查看: http://www.download-omondo.com/show_association_member.swf

如果您需要了解 UML 中的关联和 Java 中的代码生成意味着什么,然后看看这个演示:http://www.download-omondo.com/association.swf

希望有所帮助。

I found a flash demo which shows the association attribute with an icon. Look at : http://www.download-omondo.com/show_association_member.swf

If you need to understand what mean an association in UML and code generation in Java then have a look at this demo: http://www.download-omondo.com/association.swf

Hope this help.

心是晴朗的。 2024-11-15 19:59:19

ArgoUML 遵循 UML 规范。协会是从一个阶级拉到另一个阶级的。属性是在类的第二个部分内绘制的。

与属性含义最接近的关联类型是组合,但它们并不等同。

您永远不应该将某些东西描绘成一个类的属性,并且描绘成与其关联的一个单独的类。

例如 1. 订单可能有一个编号,客户可以使用该编号来识别他的订单。数字最好被描述为一个属性(在类的第二个隔间中)。

例如2.订单可以与下订单的客户相关联。客户最好被描述为一个单独的类,因为它有自己的生命周期(行为),与订单相关。这允许显示关联线两端的多重性和角色。

ArgoUML follows the UML specification. Associations are drawn from one class to another. Attributes are drawn inside the 2nd compartment of a class.

The association type closest in meaning to an attribute is composition, but they are not equivalent.

You should never portray something AND as an attribute of a class, AND as a separate class associated to it.

E.g. 1. an Order may have a Number, that may be used by the customer to identify his Order. The Number is best portrayed as an attribute (in the 2nd compartment of the class).

E.g. 2. an Order may be associated to the Customer who placed the order. The Customer is best portrayed as a separate class, since it has its own lifespan (behavior), associated with the Order. This allows to show multiplicities and roles at both ends of the association line.

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