在 UML 中,用哪种箭头连接具体类和它的抽象类?

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

UML Which arrow to connect concrete class and its abstract class?

问题

这里,在唯一的回答中,它是一个简单的箭头:
https://stackoverflow.com/questions/46049761/how-to-present-an-abstract-class-in-uml-class-diagram

但在这里,它类似于接口的箭头:
http://www.cems.uwe.ac.uk/~jsa/UMLJavaShortCourse09/CGOutput/Unit9/unit9(0809)/page_03.htm

我在考虑它是否应该和图中从类到接口的箭头相同;是这样的吗?

英文:

Here, in the only answer, it's a simple arrow:
https://stackoverflow.com/questions/46049761/how-to-present-an-abstract-class-in-uml-class-diagram

But here, it's similar to the interface arrow:
http://www.cems.uwe.ac.uk/~jsa/UMLJavaShortCourse09/CGOutput/Unit9/unit9(0809)/page_03.htm

I'm thinking it should be the same arrow as class to interface arrow of the diagram; is that right?

答案1

得分: 2

不。您引用的图片显示了一种概括情况。在这种情况下,下面的三个具体类只是从顶部的抽象类继承。顶级类的isAbstract属性只是表示您不能直接实例化它。您必须派生具体类(这些类继承属性/操作)。

引用答案中的关联仅表示具体类“Structure”处理从“Contexte”派生的具体类。您可以在右侧看到三个概括,这肯定是那些具体类。

注:从抽象类继承与实现接口类似。

英文:

No. The picture you reference shows a generalization. In that case the three concrete classes below just inherit from the abstract class on top. The isAbstract property of the top class just tells that you can not instantiate it directly. You must derive concrete classes (which inherit attributes/operations).

The assocation in the referenced answer just tells that the concrete class Structure deals with concrete classes derived from Contexte. You see three generalizations to the right which for sure will be those concrete classes.

N.B. Inheriting from an abstract class is "similar" to realizing an interface.

huangapple
  • 本文由 发表于 2020年10月7日 07:19:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/64235063.html
匿名

发表评论

匿名网友

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

确定