[squeak-dev] Re: Metaclass allInstancesDo:

Andreas Raab andreas.raab at gmx.de
Tue Jan 5 12:01:00 UTC 2010


Igor Stasenko wrote:
> If some application (like EToys) providing some extension mechanism, or hooks,
> it should provide a clear interface for it, so external components may
> register with it and unregister by will.
> Using a class hierarchy for such task seems a bad style , as to me.

Let's be careful with the judgments here. We're talking about the 
first-time initialization after Etoys has been loaded. Once it is 
initialized there is a registration mechanism but in order to pick up 
whatever extensions had been there when the package was first loaded, 
there is little alternative to a reflective invocation so it's pretty 
well motivated. In other words, I consider this fairly *good* style for 
the case in question. But back to the actual question:

>> In my image, this sentence answers true:
>> Morph class allSubInstances asSet = Morph withAllSubclasses asSet.
>>
>> Is there a reason to use allSubInstances ?

No. SomeClass class allSubInstances should always equal SomeClass 
withAllSubclasses.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list