[squeak-dev] Re: Metaclass allInstancesDo:

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Jan 5 13:15:30 UTC 2010


2010/1/5 Andreas Raab <andreas.raab at gmx.de>:
> 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
>
>

Ah thanks, now I see another difference:
allSubclasses and withAllSubclasses both answer a Set... I wonder why ?
The only usage I found in the image is in
PackageInfo>>#outsideClasses

I suggest answering an OrderedCollection



More information about the Squeak-dev mailing list