« 返回

Self-Relation

組合檢視 平均檢視 瀏覽樹狀資料
相關串連 [ 前一個 | 下一個 ]
toggle
Self-Relation
答覆
2019/3/29 上午 9:25
Hello all,
How can i define the source and destination of a relation class to point to the same entity?

for example                               __________  
                                                |       Entity      |
                                                |___________| 
                                                        /|\         |
                                                         |_____|
   
Thank you in advance

RE: Self-Relation
答覆
2019/4/30 上午 11:06 作為回覆給Christos trikalis
Hi,

in my experience it is not directly possible to create a relationship from one object (entity) to itself. You need to introduce an additional node to which you reference from the entity and reference back to the entity.
                                                 __________  
                                                |       Entity    |
                                                |___________| 
                                                        /|\         |
                                                         |         \|/
                                                         |_____O New Node

Have a look at the UML example there you find a class called associationnode in the class diagram that is what you need to implement in your scenario.

Best wishes, Thomas