Visual Studio 2008 类设计器 - 多对多关联

发布于 2024-08-11 08:52:10 字数 169 浏览 3 评论 0原文

在 Visual Studio 类设计器中是否有可视化多对多关联的技巧? 我有一个员工实体和一个团队实体。所以每个实体都有一个对应的列表。

关联可以在类设计器中显示,但仅限于 0..1 多重性。

或者有人有 VS 2010 和新架构类图的经验吗?我怀念的是生成的类 oO ...它们在哪里?!

Is there a trick for visualizing a many to many assocation in the Visual Studio Class Designer?
I have an Employee entity and a Team entity. So each entity has a list of his counterpart.

Associations are possible to show in the Class Designer, but only for 0..1 mulitplicity.

Or does anyone has experience with VS 2010 and the new architecture class diagram? What I miss there is the generated classes oO ... where they are?!

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

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

发布评论

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

评论(2

停顿的约定 2024-08-18 08:52:10

你可以在 VS 2008 上做到这一点

我用 2 个类测试了它:

public class Team
{
    public List<Employee> employees { get; set; }

}

public class Employee
{
    public List<Team> teams { get; set; }
}

将这些类添加到图表中,展开它们以显示类成员,然后选择
“作为收藏协会展示”(两次)。然后显示带有 2 个箭头的图表

You can do it on VS 2008

I tested it with 2 classes:

public class Team
{
    public List<Employee> employees { get; set; }

}

public class Employee
{
    public List<Team> teams { get; set; }
}

Added these classes to the diagram, expanded them to show class members, and then selected
"Show as Collection Association" (twice). It then shows a diagram with 2 arrows

盗琴音 2024-08-18 08:52:10

VS 2010 Ultimate 中的 UML 类图支持多对多关联。您需要在关联的First RoleSecond Role 属性上设置Multiplicity 属性。

多重值在类图上

有关详细信息,请参阅此主题:UML 类图中关联的属性

多重性 (3)

1:关联的这一端始终链接到一个对象。图中,每个菜单项都有
一个菜单。

0..1:关联的这一端要么链接到一个对象,要么没有链接。

*****:关联另一端的每个对象都链接到此处的对象集合
结束,集合可能为空。

1..*:关联另一端的每个对象都链接到此处的至少一个对象
结尾。图中,每个Menu至少有一个Menu Item。

n..m:另一端的每个对象都有一个包含 n 到 m 个指向此对象的链接的集合
结束。

我在我的个人资料上发布了更多链接,以获取有关 VS 2010 的更多信息。

The UML class diagram in VS 2010 Ultimate supports many-to-many associations. You need to set the Multiplicity property on the First Role and Second Role properties of the association.

Multiplicity values on a class diagram

For more info, see this topic: Properties of Associations in UML Class Diagrams

Multiplicity (3):

1: This end of the association always links to one object. In the figure, every Menu Item has
one Menu.

0..1: Either this end of the association links to one object, or there is no link.

*****: Every object at the other end of the association is linked to a collection of objects at this
end, and the collection may be empty.

1..*: Every object at the other end of the association is linked to at least one object at this
end. In the figure, every Menu has at least one Menu Item.

n..m: Each object at the other end has a collection of between n and m links to objects at this
end.

I've posted more links on my profile for more info about VS 2010.

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