我需要满足模型中的两个条件:
1-Node
只能有1个cutted Line
,但可以有0个或很多Line
实例。
2-节点来自cutted Line
或,Line
(但不是两者都来自)
我首先绘制波纹管领域模型。但是后来我决定通过继承来降低复杂性Edge
。
It seems that the first solution covers the second requirement, but it does not cover the multiplicity. Unfortunately the second solution covers the multiplicity but not the second condition. How can I draw it to satisfy both conditions? Update: I finally, come up with this solution:
But i am not sure if it is true or not?
That situation is called a derived union.
A
Node
comes from either aCuttedLine
, or aLine
(but not both)
The association between Line
and Node
(or CuttedLine
) subsets the association between Edge
and Node
, because if a Node
comes from a Line
(or CuttedLine
) then:
Edge
Edge
is of type Line
(or CuttedLine
)另外,之间的关联Edge
和Node
被衍生从协会之间Line
和Node
和之间CuttedLine
和Node
,因为如果一个Node
来自一个Edge
,那么它来自CuttedLine
或来源于一个Line
。UML将派生的联合定义为“作为约束其子集的所有属性的联合”。
由于Node
来自单Edge
(基数为1)和泛化是不相交的,由此得出一个Node
来自任一从一个Line
或一个CuttedLine
,但不是两者。(如果两个不同集合中的一个集合为空,而另一个集合具有单个元素,则两个集合的并集具有单个元素。)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句