Object, or Attribut, or something else...

Hans-Martin Mosner hmm at heeg.de
Mon Apr 2 08:23:30 UTC 2001


GeneCox wrote:
> 
> Hi, Smalltalkers
> 
> Almost everything in SmallTalk is interesting, but not its classes tree;-)
> 
> ... lots of stuff ...

Sorry if I don't try to answer your interesting observations in detail...
I think that there is a common misconception that Smalltalk's class tree is
somehow carrying the 'meaning' or 'intention' of Smalltalk programs. It isn't.
Class inheritance is just a mechanism for code sharing, nothing spectacular.
Objects and the messages they understand are the primary elements of interaction.

In the current Smalltalks, the relation of objects to their message catalogs
(via their class) is rather fixed, which has the undesirable effect that your
examples of accumulating and refining knowlege about some real-world entity
can not be directly modeled. But the desirable effect is that a programmer can
use an object with confidence that its behavior will not change willy-nilly
while other objects are talking to it.
Most of the attributes that you've cited in your example are of the typical
simple structure that most knowledge-representation examples have.
Things like age, current profession etc. They have nothing to do with class
based inheritance at all. It's very easy to create a kind of 'attribute-holding'
object which can dynamically gain and lose attributes.

Prototype-based languages, such as Self which Jecel mentioned, have taken that
approach to implement full systems. From a practical programming perspective,
I prefer the Smalltalk way of making classes explicit, because I feel that
code is much more tangible in such a system. However, I never did any real
development with Self, so others might have other opinions here...

Cheers,
Hans-Martin





More information about the Squeak-dev mailing list