如何在ArgoUML中绘制属性和类之间的关系?
在 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:
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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不能在 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:
I don't know if this advanced icons customization is available in this free tool but it is in other tools.
我找到了一个 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.
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.