简体   繁体   English

显示双向和组合关系UML类图

[英]Display bidirectional and composition relation UML class diagram

I have two classes Event and Review. 我有两个活动和评论类。

The event has an instance object Review in it. 该事件中有一个实例对象Review。 A review also has an object Event in it. 评论中还包含对象事件。 This means a bidirectional relationship between them (two arrows). 这意味着它们之间存在双向关系(两个箭头)。

When an event is deleted the review will also be deleted. 删除活动后,评论也会被删除。 This means a composition relationship between them (filled diamond at Event). 这意味着它们之间的组成关系(事件中填充的菱形)。

Now my question is: How can I display the two arrows and the filled diamond together in the same line? 现在我的问题是:如何在同一行中同时显示两个箭头和填充的菱形?

I'm wondering if I should left out the directional relation when showing the composition or aggregation? 我想知道在显示合成或聚合时是否应该忽略方向关系? With association the direction arrow(s) can be displayed with no problem, but having the diamond there is a problem... 有了关联,方向箭头就可以毫无问题地显示出来,但是有了菱形就出现了问题...

要回答这个问题的标题:可以使用双箭头(两端各一个)或根本不显示箭头来显示双向导航(由于关联是双向的,因此无需添加箭头)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM