在UML中,是否必须展示抽象方法的具体实现?

发布于 2024-07-20 04:23:50 字数 78 浏览 7 评论 0原文

我正在绘制一些 UML,其中一个具体类继承自一个定义纯虚拟方法的抽象类。 是否也需要在具体类中显示此方法? 这是通过从抽象类继承来暗示的。

I'm drawing some UML in which a concrete class inherits from an abstract class which defines a pure virtual method. Is it required to show this method in the concrete class as well? It's implied by inheriting from the abstract class.

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

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

发布评论

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

评论(3

熊抱啵儿 2024-07-27 04:23:50

不,你不需要。 事实上,一般来说,不要在 UML 中添加任何超出您必须必须澄清的内容的内容,除非您(上帝禁止)尝试从中生成代码。

我所知道的最好的 UML 指南是 Martin Fowler 的 UML Distilled

Nope, you don't need to. in fact, in general, don't put any more in the UML than you must have to clarify what you're saying, unless you're (god forbid) trying to generate code from it.

The best guide I know of for UML is UML Distilled by Martin Fowler.

一抹微笑 2024-07-27 04:23:50

UML 的有趣之处在于它有一个非常宽松且多样化的定义。 大多数称为 UML 的东西实际上只不过是框图。 任何 UML 实现都存在很多歧义。

我想说,如果您是为了演示或架构图而这样做,您可以用“单词”来解决很多可能的歧义。 如果您将使用某些应用程序从中生成代码,则应该检查该特定应用程序的文档。

The funny thing about UML is that it has a pretty loose and varied definition. Most things that are called UML are actually not much more that block diagrams. There is a lot of ambiguity in any UML implementation.

I would say that if you are doing this for a presentation or architectural diagram, you can take care of a lot of the possible ambiguity with 'words'. If you will be generating code from it using some application, you should check the docs of that particular application.

不打扰别人 2024-07-27 04:23:50

这是隐含的,事实上,当单击类查看其属性时,许多 CASE 工具会向您显示继承的方法作为子类方法列表的一部分(有些 CASE 工具甚至可以选择显示继承的方法)图中的方法)

It's implied and in fact, many CASE tools would show you the inherited method as part of the list of the methods of the subclass when clicking on the class at looking at its properties (and some CASE tools even have the option of showing also the inherited methods in the diagram)

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