AS1 OOP: Inheritance
by senocular
Inheritance Chains
Having classes inherit from classes which may be inheriting
from other classes, and so on and so forth, means you are
dealing with an inheritance chain. The inheritance chain
represents all the classes which are involved in the
complete line of inheritance from the current class through
all super classes up to the very first base class which, as
it exists, marks the end of the chain and itself has no
super class of its own (thereby not inheriting from anything
else). This chain represents all which would be accessible
to any derived subclass or instance of that subclass.
Taxonomy or the science of organism classification, can help
demonstrate this relationship.
Every known organism can classified through a hierarchy
of identifying categories based on Domain, Kingdom, Phylum,
Class, Order, Family, Genus and Species. Think about a brown
pelican as an example. It is categorized in the following
manner.
Domain |
Eukarya |
Kingdom |
Animalia |
Phylum |
Vertebrate |
Class |
Aves |
Order |
Pelecanifornes |
Family |
Pelecanidae |
Genus |
Pelecanus |
Species |
occidentalis |
A brown pelican is considered a part of each one of these
classifications with each one becoming more specific to what
a brown pelican as you know it (if you know it) is. Most
animals are Eukarya, fewer are Aves and fewer less are
Pelecanus. With Aves and more so with Pelecanus, however,
you are getting more specific to what a brown pelican really
is. This often too is this the case with inheritance as your
final subclass is a specific version of an inherited super
class. That super class too could be a specific version of a
yet less specific super class.