[KCP] SystemDictionary cleaning: Comments and design

Jecel Assumpcao Jr jecel at merlintec.com
Tue Jun 17 14:24:39 UTC 2003


On Monday 16 June 2003 23:40, Tim Rowledge wrote:
> > I would also like to hear his view about globals holding onto
> > instances of a class. Like "Smalltalk" holding a "SystemDictionary"
> > and "Transcript" holding a "TranscriptStream".
>
> Here's mine; having a singleton global strikes me as a bit pointless
> so gues I'd prefer for example to see a class called Smalltalk than a
> global called Smalltalk and its class SystemDictionary. On the other
> had, we can have many TranscriptStreams and so a generally accessible
> global Transcript is perfectly sensible.

Good point.

> and from earlier mail:-
>
> >- "System fullNameForChanges:" is simpler than "Changes fullName:"
> >- "System fullNameForImage:" is simpler than "Image fullName:"
> >- "System listBuiltinModules" is simplar than: "BuiltinModules list"
> >- "System listLoadedModules" is simplar than: "LoadedModules list"
>
> Whilst I just about agree that having a class for Changes and one for
> Image is ok I really think that it is going too far to have
> LoadedModules and BuiltinModules. Those are examples where the
> mapping simply doesn't make sense. Something more like Image
> loadedPlugins and Image builtinPlugins would be a little more
> approachable.
>
> I know classes are pretty lightweight but let's not go down a path
> that ends up with One class and Two class and FortyTwo class etc.

Why can't Changes and Image be two instances of some class (SystemFile? 
VMFile?)? Same thing for BuiltinModules and LoadedModules - they could 
be instances of the same class. After all, they seem to understand the 
same messages. This seems like the same thing you were saying about 
Transcript as a TranscriptStream instance above.

I guess I would also have a Sources global of the same class as Changes 
and Image.

Note that I hate globals in general (my own Smalltalk implementation 
doesn't have them!) and think that classes are normally the way to go 
when you have to have them. But in the few cases where the most natural 
solution is a global instance, why not?

-- Jecel



More information about the Squeak-dev mailing list