A Critique of the Inheritance Principles of C++

Although multiple inheritance (MI) is al- ready a feature of the C# language, there is a debate going on about its good and bad sides. In this paper, I am defending MI. At the same time, many of the rules and principles of inheritance in current C# seem to me to need improvements. The suggested modifications are relatively simple, do not introduce many new re- served words, and should not affect other parts of the language. I do not find the current rules totally adequate even for single inheritance (SI). The problems lie in the mean- ing of access levels and in the redefinability of virtual functions. Additional inconsistencies in C# virtual functions appear in so-called independent multiple in- heritance (IMI), which is in principle the easy case of MI. The most difficult problems are caused by so- called fork-join inheritance (FJI), which is the most complicated kind of inheritance. One essential cause of complexity is private inheritance because of its intransitive nature. The main idea sug- gested here is that, simply put, private inheritance should be implicitly "non-virtual" and public inheri- tancs "virtual." This is actually a simplification of the language, at least from the programmer's if not from the implementor's point of view. The main rule has

[1]  David H. Taenzer,et al.  Problems in Object-Oriented Software Reuse , 1989, ECOOP.

[2]  Alan Snyder,et al.  Modeling the C++ Object Model, An Application of an Abstract Object Model , 1991, ECOOP.

[3]  Bjarne Stroustrup,et al.  Multiple Inheritance for C++ , 1989, Comput. Syst..

[4]  Thomas A. Cargill,et al.  Controversy: The Case Against Multiple Inheritance in C++ , 1991, Comput. Syst..

[5]  Bent Bruun Kristensen,et al.  The BETA Programming Language , 1987, Research Directions in Object-Oriented Programming.

[6]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[7]  Markku Sakkinen,et al.  Disciplined Inheritance , 1989, ECOOP.

[8]  Jim Waldo,et al.  The case for multiple inheritance in C , 1993 .

[9]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

[10]  Keith E. Gorlen An object‐oriented class library for C++ programs , 1987, Softw. Pract. Exp..

[11]  Karl J. Lieberherr,et al.  From objects to classes: algorithms for optimal object-oriented design , 1991, Softw. Eng. J..

[12]  Markku Sakkinen On the Darker Side of C++ , 1988, ECOOP.

[13]  Brian W. Kernighan,et al.  The C Programming Language, Second Edition , 1988 .

[14]  Craig Schaffert,et al.  CLU Reference Manual , 1984, Lecture Notes in Computer Science.

[15]  Paul R. Calder,et al.  The Design and Implementation of InterViews , 1993, C++ Workshop.

[16]  Markku Sakkinen The Darker Side of C++ Revisited , 1992, Struct. Program..

[17]  Ole Lehrmann Madsen Block-structure and object-oriented languages , 1987 .

[18]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[19]  Doug Lea Customization in C++ , 1990, C++ Conference.