显示构图和使用 Visual Studio 2008 的类图中的依赖关系

发布于 2024-08-21 22:54:31 字数 59 浏览 3 评论 0原文

我试图使用 VS 2008 在类图中显示组合和依赖关系,但没有与上述关系相关的图表。请帮我解决这个问题。

I am trying to display a composition and dependency relationship in a class diagram using VS 2008, but there are no diagrams associated with the above mentioned relationship. Please help me with this.

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

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

发布评论

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

评论(2

与酒说心事 2024-08-28 22:54:31

Visual Studio 2010 Ultimate 支持 UML 类图上的组合、依赖关系和许多其他关系:

UML 类图:参考http://msdn.microsoft.com/en-us/library/dd409437%28VS.100%29.aspx

UML 类图

5关联:两个分类器的成员之间的关系。

5a聚合:表示共享所有权关系的关联。这
所有者角色的聚合属性设置为共享

5b组合:表示整体与部分关系的关联。 聚合
所有者角色的属性设置为Composite

9泛化:特定分类器从通用分类器继承其部分定义
分类器。通用分类器位于连接器的箭头端。属性、关联和
操作由特定的分类器继承。使用继承工具创建
两个分类器之间的泛化。

替代文本

13导入:包之间的关系,表明一个
包包含另一个包的所有定义。

14依赖:依赖分类器的定义或实现可能会改变,如果
箭头端的分类器已更改。

替代文本

15实现:类实现接口定义的操作和属性。
使用继承工具在类和接口之间创建实现。

16实现:同一关系的另一种呈现方式。标签上的
棒棒糖符号标识接口。

UML 类图:指南http://msdn.microsoft.com/en-us/library/dd409416%28VS.100%29.aspx

协会的属性

聚合:这在连接器的一端显示为菱形。你可以用它来
指示聚合角色的实例拥有或包含另一个角色的实例。

可导航:如果仅对一个角色为 true,则可导航方向会出现一个箭头。你可以使用
这表明软件中链接和数据库关系的可导航性。

泛化:泛化意味着专门或派生类型继承属性,
通用或基本类型的操作和关联。一般类型出现在箭头处
关系结束。

实现:实现是指类实现了指定的属性和操作
界面。接口位于连接器的箭头端。

如果您还有其他问题,请告诉我。

Visual Studio 2010 Ultimate supports composition, dependency, and many other relationships on UML class diagrams:

UML Class Diagrams: Reference: http://msdn.microsoft.com/en-us/library/dd409437%28VS.100%29.aspx

UML class diagram

5: Association: A relationship between the members of two classifiers.

5a: Aggregation: An association representing a shared ownership relationship. The
Aggregation property of the owner role is set to Shared.

5b: Composition: An association representing a whole-part relationship. The Aggregation
property of the owner role is set to Composite.

9: Generalization: The specific classifier inherits part of its definition from the general
classifier. The general classifier is at the arrow end of the connector. Attributes, associations, and
operations are inherited by the specific classifier. Use the Inheritance tool to create a
generalization between two classifiers.

alt text

13: Import: A relationship between packages, indicating that one
package includes all the definitions of another.

14: Dependency: The definition or implementation of the dependent classifier might change if
the classifier at the arrowhead end is changed.

alt text

15: Realization: The class implements the operations and attributes defined by the interface.
Use the Inheritance tool to create a realization between a class and an interface.

16: Realization: An alternative presentation of the same relationship. The label on the
lollipop symbol identifies the interface.

UML Class Diagrams: Guidelines: http://msdn.microsoft.com/en-us/library/dd409416%28VS.100%29.aspx

Properties of an Association

Aggregation: This appears as a diamond shape at one end of the connector. You can use it to
indicate that instances at the aggregating role own or contain instances of the other.

Is Navigable: If true for only one role, an arrow appears in the navigable direction. You can use
this to indicate navigability of links and database relations in the software.

Generalization: Generalization means that the specializing or derived type inherits attributes,
operations, and associations of the general or base type. The general type appears at the arrowhead
end of the relationship.

Realization: Realization means that a class implements the attributes and operations specified by
the interface. The interface is at the arrow end of the connector.

Let me know if you have more questions.

三生池水覆流年 2024-08-28 22:54:31

正如您自己所发现的,VS2008 中的类图并不提供 UML 类图的所有功能。 Visual Studio 2010 中引入了新的“UML 类图”来解决这个问题。

As you have discovered yourself, the Class Diagram in VS2008 does not provide all of the functionality of a UML Class Diagram. A new "UML Class Diagram" has been introduced in Visual Studio 2010 to address this.

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