Overriding #class

Martin Beck martin.beck at hpi.uni-potsdam.de
Tue Nov 13 10:56:02 UTC 2007

Bert Freudenberg schrieb:
> Wouldn't overriding #class break more things than it solves? After all, 
> your object's class is not what it would claim to be.
> Which "normal behavior" would you like to "retain"?
Infact, we don't want to override Object>>#class but the #class in our 
generated anonymous class. It would look like this:

	^self baseClass

So normal system behaviour is not changed, only if you alter an instance 
by for example adding a method, an anonymous class in the class chain is 
inserted which overrides the #class method. One reason to do this, is 
that the CodA paper specifies this behaviour, too. Another one would be, 
if somewhere in the system instances are tested for their classes (which 
shouldn't be the case...).

But it seems, that this is not possible in an easy way...


More information about the Squeak-dev mailing list