带箭头和不带箭头的 UML 聚合的区别
Difference of UML Aggregation with and without arrow head
注意:这不是uml-aggregation-with-and-without-arrow-head的副本,而是改进和修正的版本!
在uml-aggregation-with-and-without-arrow-head中,聚合被解释为黑色填充钻石。这显然是 WRONG,因为 FILLED 钻石是合成的。直到现在我还没有看到带箭头的构图,所以我的问题是在 aggregation
的上下文中
我提问的动机来自Gof23。那本书中的 class 图包含带箭头的聚合。所以我对此很困惑,因为我通常只使用没有箭头的聚合
问题:有箭头的聚合有什么区别<>----->
和没有箭头的聚合箭头<>-----
?
你问题的答案与我对问题的回答相同
What is the difference between composition with an arrow head <>----->
and composition without arrow head <>-----
?
见,除了你必须用空心菱形(聚合[=27]替换实心菱形(组合) =]).
既然你问的是导航箭头的使用,答案不取决于关联的种类(普通、聚合、复合)。所以,你也可以完全放下钻石并询问
What is the difference between association with an arrow head ----->
and association without arrow head -----
?
仍然得到相同的答案。
注意:这不是uml-aggregation-with-and-without-arrow-head的副本,而是改进和修正的版本!
在uml-aggregation-with-and-without-arrow-head中,聚合被解释为黑色填充钻石。这显然是 WRONG,因为 FILLED 钻石是合成的。直到现在我还没有看到带箭头的构图,所以我的问题是在 aggregation
的上下文中我提问的动机来自Gof23。那本书中的 class 图包含带箭头的聚合。所以我对此很困惑,因为我通常只使用没有箭头的聚合
问题:有箭头的聚合有什么区别<>----->
和没有箭头的聚合箭头<>-----
?
你问题的答案与我对问题的回答相同
What is the difference between composition with an arrow head
<>----->
and composition without arrow head<>-----
?
见,除了你必须用空心菱形(聚合[=27]替换实心菱形(组合) =]).
既然你问的是导航箭头的使用,答案不取决于关联的种类(普通、聚合、复合)。所以,你也可以完全放下钻石并询问
What is the difference between association with an arrow head
----->
and association without arrow head-----
?
仍然得到相同的答案。