英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论