[modules] How to convert pools

Les Tyrrell tyrrell at iserve11.lis.uiuc.edu
Sun Feb 3 17:24:18 UTC 2002


Andreas Raab wrote:

> > But you won't be able to use this code as proper module code 
> > anyway as pools break modularity.
> 
> I don't understand this. Why would they? Pools where the only kind of
> globals that were actually scoped across the class hierarchy in a
> halfways reasonable way, so what's the difference between using a pool
> and importing a module and why would using pools break modularity?

I agree with Andreas- I don't see how you can claim that Pools break modularity.  There is nothing about them that I can see that is a problem here.  In fact, they act very much like a weak form of modules, in that they are containers of publicly exported variables.  The SystemDictionary Smalltalk was the same way, as was Undeclared and a few other "true" Pool dictionaries ( by this, I am excluding the PoolDictionaries that were/are used by Classes to maintain the so-called "Class Variables" - those were a contextually different useage of these dictionaries ).  Pools are certainly a special case in that the previous implementation of them was something of a hack, ( ie, Pools wanted to both contain variables in a dictionary-like way, but also wanted to have certain behavior-like capability, in order to define its initialization- this was a "hack" as the pool referenced a "defining class" in order to accomplish this, thereby putting the initialization burden onto another object where it could very well be argued that responsibility really didn't belong ).  But I don't see how that makes them "break modularity".

It seems to me that the proper fix is to upgrade Pools to objects which have some dictionary-like and some behavior-like behavior ( really, all that is required is that the pool be able to initialize itself, without having that code living on some other object as is done now  ).   ( and I suppose that this is where David will point out that this is where he wanted the instance-specific behavior for modules, since really a Pool is a just a (possibly) weakened form of module... or is it that modules are extended forms of Pools? )

- les





More information about the Squeak-dev mailing list