Object: Identity vs. Environment

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Mon Jun 9 06:03:47 UTC 2003


On Mon, Jun 09, 2003 at 05:11:44PM +1200, Richard A. O'Keefe wrote:
> Joel Shellman <joel at ikestrel.com> continues the #isFoo debate.
> 	> in Color, one would have to write
> 	>
> 	>     fulfills: aSymbol
> 	>         ^aSymbol == #Colorness or: [super fulfills: aSymbol].
> 	>
> 	> That is, every method which asserts that instances of a class have
> 	> some property would be MORE complicated than the corresponding
> 	> #isFoo method would have been.
> 	
> 	No, you wouldn't do it that way--as you say, that would indeed
> 	be bad.  The entire implementation could be in Object.  Object
> 	would create a dictionaryOfFulfilling and then:
> 
> 	Object>>fulfills: aSymbol
> 	    ^dictionaryOfFulfilling containsKey: aSymbol
> 
> I am having some trouble believing that someone would go to the
> extreme of adding an extra instance variable to EVERY OBJECT just so
> that a bunch of #isFoo methods can be replaced by a vastly less
> efficient approach which is based on coupling that would make the
> most hardened software engineer weep.

<killing time while Squeak is chugging on some data>

I was going to write the same earlier today, but (reading between the
lines), I think that Joel means each class would have such a
dictionary, not each object.  If he means that each object should have
a Dictionary, his proposal becomes completely absurd.  Many of my
images have well over a million objects, translating to 4 megabytes of
pointer space alone.  And then you have the Dictionaries held by the
pointers.  And then you have the extra pointers in the Dictionaries.
Not to mention the extra Dictionaries in the extra pointers in the
Dictionaries.  Not to mention...

Phew, that could have gone on for a while, had my image not finished
chugging :-)

Joshua



More information about the Squeak-dev mailing list