0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SubtypingとInheritanceを区別する

Last updated at Posted at 2021-01-30

はじめに

SubtypingとInheritanceについて説明します。
両者の違いを理解します。[1]を参照します。

Subtyping (サブタイピング)

Subtyping refers to compatibility of interfaces. A type B is a subtype of A if every function that can be invoked on an object of type A can also be invoked on an object of type B.

Subtypingはinterfaceの互換性に着目します。
AのすべてのfunctionがBにおいても呼び出すことができる場合、BをAのsubtypeといいます。

Inheritance (継承)

Inheritance refers to reuse of implementations. A type B inherits from another type A if some functions for B are written in terms of functions of A.

Inheritanceは実装の再利用に着目します。
AのfunctionによってBのいくつかのfunctionが実装されている場合、BはAを継承します。

References

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?