简体   繁体   English

与Visual Studio 2010建模项目的属性关系

[英]Property relationships with Visual Studio 2010 Modeling Projects

I have a problem. 我有个问题。 I need to create a UML design, but specifying for relationships between classes which properties are the ones relating the classes. 我需要创建一个UML设计,但是要为类之间的关系指定哪些属性是与类相关的属性。 I want to create a Visual Studio modeling project, but I can't seem to find how to associate specific properties of two classes in a class diagram. 我想创建一个Visual Studio建模项目,但似乎找不到如何在类图中关联两个类的特定属性的方法。 Is it possible? 可能吗?

Best regards, David 最好的问候,大卫

The way to do this is with associations. 完成此操作的方法是使用关联。 You don't add the attributes to the classes - instead, you draw an association between them. 您无需将属性添加到类中,而是在它们之间绘制关联。 In UML, an association represents a pair of attributes. 在UML中,关联表示一对属性。 To give the attributes names, you set the role names on each end of the association. 要指定属性名称,请在关联的每一端设置角色名称。 If you want to represent a pair of attributes, set IsNavigable=true on both roles. 如果要表示一对属性,请在两个角色上都设置IsNavigable = true。

Cheers Alan 干杯艾伦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM