the monopoly of classes

jan ziak ziakjan at host.sk
Fri May 23 01:23:57 UTC 2003


On Fri, 23 May 2003 01:37:16 +0200, Andreas Raab wrote
> > more precissely:
> > 1. every object includes a field which contains a reference 
> > to its "class object"
> > 2. object Class includes a reference to its "class object" also
> 
> Well, actually the above is NOT precise but preciseness is besides 
> the point here. The question is "do all objects need to know their 
> class or not"...
> 
> > my question is: do all objects really need to contain that field ?
> 
> ... which is stated here. And the answer is: No, they don't. There 
> is no reason for this other than that it is hugely more efficient in 
> terms of both speed and space to do it that way.
> 
> Mind you it's called "object" oriented not "class oriented" (though many
> people tend to forget it). "Object" oriented means that every object 
> needs to define some behavior. And one of the ways to do that is to 
> observe that "hey, many of these guys are essentially the same, so 
> why not have a common abstraction for it".

yes, but in class-ified object oriented systems (like smalltalk) the 
procedure you just described cannot be performed, because it is not "first 
make some objects and if obvious then make a common class object" but it 
is "make a common class object in any case".

> And then someone said "hm ... maybe 'class' is a good name for this
> abstraction?".
> 
> And surely, it is. But there is no requirement for an OO language to 
> include classes. Squeak just happens to do it that way. But many 
> others OO languages
> (including JavaScript) don't have any of these explicit common abstractions.
> 
> Cheers,
>   - Andreas






More information about the Squeak-dev mailing list