stason.org logo lotus


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

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

 Books
 TULARC
















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:


Share and Enjoy

Bookmark this story so others can enjoy it:
  • digg
  • Reddit
  • del.icio.us
  • Furl
  • Wists

Tags

programming, software, coding, Object-Oriented, language, dynamic binding, constructor, destructor, overriding, methods, inheritance, reflection, persistence, MFC, real-time, polymorphism, system, database, vendor







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