UML Diagram: Reflexive Association with class instance clarification

流过昼夜 提交于 2020-01-06 06:10:22

问题


I used a plug-in in Eclipse Neon which is called ObjectAid, it's a plug-in that generates a UML Diagram automatically.

Now I understand everything in the generated UML except for one thing, which is the label next to the arrow "~class instance". What does that part mean?

This is just an identical image, not the real one, of the UML generated so please understand that that's just an example.

EDIT:

//more codes here
static APAGenerator generateAPA = new APAGenerator();

public static void main(String[] args) {
    try {
        generateAPA.run();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
//more codes here

回答1:


Well, I can't speak for this ObjectAid (and what their makers thought they should do), but as per UML specification the ~ tells the visibility is package and it's followed by the role name which the association takes (IOW: the attribute being used). So the name is class instance which seems odd.




回答2:


@Helquin, you should code in java ?

If you do not specify the visibility the default is private-package. It explains the visibility.

Note: protected in java is also package (see java visibility).

But instead having ~class instance, you should get an underlined ~generateAPA with a cardinality of 1.



来源:https://stackoverflow.com/questions/47250682/uml-diagram-reflexive-association-with-class-instance-clarification

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!