superSuper, was super super

John M McIntosh johnmci at smalltalkconsulting.com
Sat Feb 19 06:45:14 UTC 2000


> At 13:42 -0800 2/16/2000, Randal L. Schwartz wrote:
>> >>>>> "Yoshiki" == Yoshiki Ohshima <ohshima at is.titech.ac.jp> writes:
>>
>>Yoshiki>    super super addCustomMenuItems: aCustomMenu hand: aHandMorph.

> Amen. Adding super super just makes the tangled mess worse. If a class
hierarchy is designed for subclassing, it should not have places where it is
difficult to override methods. I've found morphs which open themselves in
#initialize, and overrides which are forced to use #basicNew and other
contortions to add a new variable and initialize it before sending
#initialize.
>
> A language patch cannot substitute for clean design. A language patch like
superSuper (not super super) can only make life more difficult.
>
> Besides, imaging trying to tell someone what it does!
>
> Dave

Gee here I was at 38,000 feet friday reading Kent Beck's Guide to a Better
Smalltalk and lo, there is his Oct 1993 article on "Helper methods avoid
unwanted inheritance" ie super super , then I attempt to catch up on my
squeak mail and lo here is a long thread on super super.

So what did Kent say. Well C++ which has such an facility is a maintenance
nightmare if you use that facility. The solution is a pattern were you place
the code you don't want to inherit in it's own method, change the original
method to call that new method. Now in the subclass you just define that
method as ^self or do something more meaningful. Thus with some refactoring
you avoid the need for super super by making the underlying structure more
flexible

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list