我正在研究锻炼跟进程序的设计。我有以下关系图,我想用它创建一个类图。
在这种情况下,我应该创建一个关联表,如下所示:
解释这种关系:肌肉可能是许多不同运动的目标,运动可能针对许多肌肉。
以下表示是否正确? 我们能改进它吗?
如果它不正确,任何人都可以建议在类图中表示它的最佳方法吗?
I'm working on a design of a workout follow up program.I have the following relational diagram and I want to create a class diagram with it.
In this case I should create an associative table as follow:
To explain the relation: a muscle may be targeted by many different exercises and an exercise may target many muscle.
Is the following representation correct? Can we improve it?
If it is not correct, can any one suggest the best way to represent it in a class diagram?
最满意答案
你的图几乎是正确的。 您应该将所有出现的List<...>替换为关联结束属性。 为此,您需要两个关联。 这是一个例子:
我冒昧地改变了初选的多样性。 我认为每个方向至少有一个方向。 这表明为什么使用关联更具表现力 - 使用List<...> ,您无法表达最小和最大基数。
Your diagram is almost correct. You should replace all the occurrences of List<...> with association-end properties. To do this, you will need two associations. Here's an example:
I took the liberty of changing the multiplicity for the primaries. I think each direction has at least one. This shows why using associations is more expressive--with a List<...>, you cannot express min and max cardinalities.
更多推荐
发布评论