为什么箭头会继承?

bob*_*obo 8 language-agnostic inheritance

绘制继承图时,通常会去

                         Base
                           ^
                           |
                        Derived

派生延伸基地.那箭头为什么会上升?

我认为这意味着"Derived与Base通信"通过调用其中的函数,但Base不能调用Derived中的函数.

Pét*_*rök 6

AFAIK的原因之一是符号的一致性.所有其他有向箭头(依赖性,聚合,组合)指向从属到依赖性.

在继承中,B依赖于A但不依赖于A. 因此箭头指向B到A.

  • 传承是物质内涵。`B => A` 的意思是“每个 B 都意味着一个 A”。 (2认同)

Chr*_*bek 5

在 UML 中,箭头称为“泛化”关系,它仅表示 Derived 类的每个对象也是 Base 类的对象。

\n\n

从上层建筑2.1.2:

\n\n
A Generalization is shown as a line with a hollow triangle as an\narrowhead between the symbols representing the involved classifiers.\nThe arrowhead points to the symbol representing the general \nclassifier. This notation is referred to as the \xe2\x80\x9cseparate target style.\xe2\x80\x9d\n
Run Code Online (Sandbox Code Playgroud)\n\n

虽然不是问题的真正答案:-)

\n


Dev*_*ler 5

将箭头读作“继承自”,这是有道理的。或者,如果您愿意,可以将其视为可以进行方向调用。