如何在UML中显示一个类与java.lang类的关系?

huangapple go评论66阅读模式
英文:

How do I show the relationship of a class to a java.lang class in UML?

问题

我想展示一个类在 UML 图中继承自JLabel并实现了MouseMotionListener接口。应该是什么样子的?我需要在图中包含他们实现的所有方法吗?我是否需要展示这种关系?

英文:

I want to show that a class inherits from JLabel and implements MouseMotionListener in a UML diagram. What should that look like? Do I need to include all the methods they implement in the diagram?? Do I even need to show that relationship at all??

答案1

得分: 3

根据情况而定。您可以简单地放置仅使用其类名的 JLabel,并向其绘制一般化关系。还有一个带有指向它的实现的 «interface» MouseMotionListener。然而,如果您对这种细节水平不感兴趣(和/或如果编码人员能够牢记所需内容),您也可以省略它;我不确定,但我可能不是您文档的受众)。

如何在UML中显示一个类与java.lang类的关系?

英文:

It depends. You could simply place JLabel with only its classname and draw a generalization towards it. And an «interface» MouseMotionListener with a realization towards it. However, you can also omit that if you are not interested in such a detail level (and/or if the coder would known by heart that it's needed; I wouldn't know but I'm likely not an audience for your documenentation).

如何在UML中显示一个类与java.lang类的关系?

huangapple
  • 本文由 发表于 2020年9月4日 07:43:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/63733025.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定