Multiple inheritance in Java/C#

Dieter Maurer dieter at handshake.de
Thu Nov 20 14:41:38 EST 2003


Thomas <pushcold at hotpop.foo> writes on Wed, 19 Nov 2003 15:55:28 +0100:
> On Tue, 18 Nov 2003 20:31:35 -0800, Hung Jung Lu wrote:

> ... lacking multiple inheritance ...
> At least, the compiler tells you exactly what to do; in my 
> experience, this leads to very stable applications, even if the
> application gets very large. (If you work with MI, it might happen
> as well that you have to change many classes when you make changes
> to the base classes.)

I am a fan of inheritance. Only multiple inheritance provides
mix in classes that let you construct your class out of
components: you need persistence, add a "Persistence" mixin class;
you need properties, add a "PropertyManager" class;
you need indexing, add an "Indexible" class....

I build complex systems (multi-media database, E-Commerce platform,
content management system)
making extensive use of multiple inheritance
(C++ and Python). I think, I do it extremely fast and efficient --
both for the initial implementation as well as for maintenance.
Much more efficient than in a language without multiple inheritance
(I have Java experience, as well).

It is *very* rare in practice that a base class change affects derived classes,
although it is easy to construct examples for this case.

> I hope that C# uses it's chance of being a (IMHO) well designed
> language, which can concentrate now on performance and stability
> issues (and not on implementing new features). Python used to be
> that way, but in the last time, it is developing too fast (IMHO).

It would only be too fast, when it would introduce a high rate of
errors. Nobody hinders you to stay behind...


Dieter




More information about the Python-list mailing list