inheritance
3. b.
fig
. Any property, quality, or immaterial
possession inherited from ancestors or previous generations.
-- Oxford English Dictionary,
2nd edn
A
class
may
inherit
operations from 'superclasses' and may have its operations inherited
by 'subclasses'. An
object
of the
class
C
created by the operation 'C new' has
C
as
its 'base class' and may use operations defined in its base class as
well as operations defined in superclasses. Inheritance from a
single superclass is called single inheritance; inheritance from
from multiple superclasses is called
multiple inheritance
.
-- Wegner. Dimensions of
object-based language design. OOPSLA 1987
... in defining a new
class
it is
often very convenient to start with all the variables and methods of
an existing class and only add some more in order to get the desired
new class. The new class is said to
inherit
the variables
and methods of the old one. (Note that inheritance is a relationship
between classes, not between instances.)
...
Suppose that the
class
B
has
inherited
all the variables and methods from the class
A
. Then, in a way, we can consider every instance of
B
equally well as an
object
of class
A
: at any point where an object of
A
is expected
(because certain messages are sent to it), any object of class
B
will satisfy our needs, because it will accept all the messages that
an object of class
A
would accept. Therefore the instances
of
B
can be considered specialised versions of the ones in
class
A
. This can be expressed by calling the class
B
a subclass of
A
and
A
a superclass of
B
...
...
... it is possible to allow a new
class
to inherit from more than one existing class. This mechanism is
called
multiple inheritance
...
-- America, 1989
Class
inheritance
is a
mechanism for composing the interface of one or more inherited
classes with the interface of the inheriting class. Inherited
classes are called
superclasses
and inheriting classes are
calles
subclasses
. Operations of a superclass can be
accessed by its subclasses provided there are no name conflicts.
Occurrences of "
self
" in an operation definition
refer to the object on behalf of which the operation is being
executed rather than to the class in which the operation is
textually defined.
-- Wegner.
The Object-Oriented
Classification Paradigm
. 1987