lotus

previous page: 1.10) What Is Dynamic Inheritance? (Object-Oriented Technology)
  
page up: Object-Oriented Technology FAQ
  
next page: 1.12) Why Use Inheritance? (Object-Oriented Technology)

1.11) What Is Shared (Repeated) Inheritance? (Object-Oriented Technology)




Description

This article is from the Object-Oriented Technology FAQ, by Bob Hathaway rjh@geodesic.com with numerous contributions by others.

1.11) What Is Shared (Repeated) Inheritance? (Object-Oriented Technology)

Multiple Inheritance brings up the possibility for a class to appear as a
parent more than once in a class graph (repeated inheritance), and there is
then a potential to share that class. Only one instance of the class will
then appear in the graph (as is always the case in CLOS, because all *members*
with the same name will be shared (receive a single slot) with the greatest
common subtype as its type). C++ provides an alternative, where only parents
specified as virtual (virtual bases) are shared within the same class lattice,
allowing both shared and non-shared occurrences of a parent to coexist. All
"features" in Eiffel (C++ members) of a repeated parent that are not to be
shared must be renamed "along an inheritance path", else they are shared by
default. This allows a finer granularity of control and consistent name
resolution but requires more work for parents with many features.

 

Continue to:













TOP
previous page: 1.10) What Is Dynamic Inheritance? (Object-Oriented Technology)
  
page up: Object-Oriented Technology FAQ
  
next page: 1.12) Why Use Inheritance? (Object-Oriented Technology)