[squeak-dev] LRUCache to Balloon?

Frank Shearar frank.shearar at gmail.com
Sat Nov 23 09:48:42 UTC 2013


On 22 November 2013 19:43, Chris Muller <ma.chris.m at gmail.com> wrote:
>
>> > You said there are already two places where it's used, right?  If
>> > there's even just ONE MORE place that pops up, we'll find that clearly
>> > Balloon (WTH?) is the wrong place for it.
>> >
>> >   http://www.codinghorror.com/blog/2013/07/rule-of-three.html

Three strikes & refactor is a great rule. And I'm happy for someone 6
months from now to go "what the hell, why did Frank put LRUCache into
Balloon. It has the obviously right place <here>." But we've now
expended more effort between 3+ people than would have taken for me to
put LRUCache into Balloon AND pay for inventing the right place AND
still have time left over for beer.

>> > I think you should stay consistent in your statements about
>> > "modularity."  It wraps a Dictionary, it supplies #at: for access.
>> > You said if it walks and quacks like a collection, it goes in
>> > Collections.
>>
>> No, I said that was a rubbish reason for grouping things together :)
>
>
> What then?  A separate package for every kind of Collection?

I think we're both guilty of strawmanning each other :) No, of course
not. Having each class in a separate package ruins the point of a
package. I mean, it _packages_, so a package must _group_.

For Collections, I want to push all the collections that Kernel uses -
OrderedCollection, Array, ... - into Kernel. For any that are left, I
don't particularly care, as long as they don't cause unnecessary
coupling between packages. That shouldn't be a problem for
Collections, except that Collections depends on System.

But back to the point: LRUCache clearly doesn't belong to System.
There's no obviously right place for it in any of the other packages.

So we have a class that doesn't really belong to any other package.
It's only used by Balloon and Morphic (and Morphic depends on
Balloon). So we can
* put LRUCache in Collections and hold our noses, or
* put LRUCache in Balloon and hold our noses, or
* put LRUCache in its own package, Caches, and hold our noses.

frank


More information about the Squeak-dev mailing list