如何在Java UML类图中显示包含其他类的抽象类?

发布于 2025-02-02 00:54:40 字数 160 浏览 2 评论 0原文

寻找有关如何绘制包含不同类型类型的私有变量(即非重要变量)的私有变量的箭头的澄清。我以此为例,不确定是否正确。

图像:“我在这里制作的示例”

这是正确的吗?

Looking for clarification on how to draw the arrows for an abstract class which contains private variables of a different class type (i.e. non-primitive variables). I've got this as an example and was not sure if correct.

Image: Example I made here

Is this correct?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜还是长夜 2025-02-09 00:54:40

而不是实现,这意味着更多用于接口实现的意义,您应该使用简单的概括使用实线。这是关于混凝土从抽象类继承的继承。这也意味着该关联是继承的,这将不是事实。

由于 Christophe 提到了这一点:无需在继承类中重复操作/属性。参见UML 2.5的第100页:

由分类器继承的成员可以通过将caret'^'符号预先到文本表示形式中,以显示该分类器的图表,如果成员未继承,该符号将显示。 [...]
也可以以较浅的颜色显示继承的成员,以帮助将其与非亲戚成员区分开。符合的实现不需要提供此选项。

Rather than Realization which is meant more for interface realization you should use simple Generalization with a solid line instead. This is about inheritance where the concrete inherit from the abstract classes. This means also that the association is inherited which for a realization would not be the case.

Since Christophe mentioned it: There is no need to repeat operations/attributes in the inheriting class. See pp. 100 of UML 2.5:

Members that are inherited by a Classifier may be shown on a diagram of that Classifier by prepending a caret ’^’ symbol to the textual representation that would be shown if the member were not inherited. [...]
Inherited members may also be shown in a lighter color to help distinguish them from non-inherited members. A conforming implementation does not need to provide this option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文