英文:
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
。然而,如果您对这种细节水平不感兴趣(和/或如果编码人员能够牢记所需内容),您也可以省略它;我不确定,但我可能不是您文档的受众)。
英文:
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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论