Georg Heeg | 7 Jun 2012 17:35
Picon
Favicon

Re: Multiple Inheritance

Andre,

In the very early 1980ies there was an implementation of multiple
inheritance in Smalltalk written by Alan Borning
(http://www.aaai.org/Papers/AAAI/1982/AAAI82-056.pdf). As this part of
VisualWorks has never changed, it should still work in current version with
reasonable adaptations.

There is also a concept called Traits
(http://en.wikipedia.org/wiki/Trait_(computer_programming) ) you will find
current implementations.

Since the early 1980 there have been discussions about multiple inheritance
in Smalltalk. The conclusion have always been: You don't want it. The most
simple version is: It makes it harder to read code. And reading
(understanding) is the predominant activity in Smalltalk programming.

Typically the desire for multiple inheritance have been a sign of
sub-optimal design and lack of understanding of the domain. The general
solution has been: refactoring and delegation.

Georg

Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812
Wallstraße 22, 06366 Köthen
Tel. +49-3496-214328, Fax +49-3496-214712

-----Ursprüngliche Nachricht-----
Von: vwnc-bounces <at> cs.uiuc.edu [mailto:vwnc-bounces <at> cs.uiuc.edu] Im Auftrag
von andre
Gesendet: Donnerstag, 7. Juni 2012 17:06
An: VWNC list
Betreff: [vwnc] Multiple Inheritance

Hi,

while porting from Smalltalk to C++, I found that multiple inheritance is
extremely expressive and helps keep the class tree at a reasonable,
relatively low depth. Aside from static typing being a pain, the C++ way of
assembling classes from "LEGO blocks of behavior" is fantastic. 

I would even dare to say this is far superior compared to a strict
hierarchy. I often feel I am forced to put a class where it actually doesn't
belong, only to avoid writing redundant code. It also leads to deep and
bloated trees with multiple implementations of very similar behavior.

The base image could possibly be 1/4 of its current size with multiple
inheritance?

Are there Smalltalk frameworks that support it? I mean, not something that
is based on redirection of DNU exceptions. I would love a real toolset that
comes with its own browser, compiler, etc.

I could imagine that it would be possible, in theory, to "unfold" a multiple
inheritance network into a class hierarchy by physically duplicating the
sources of the involved superclasses automatically. Kind of Just-In-Time
preprocessor. 

Any hope?

Andre

_______________________________________________
vwnc mailing list
vwnc <at> cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Gmane