BUG with OrderedCollection new writeStream ?
Andreas Raab
andreas.raab at gmx.de
Fri Sep 21 05:25:17 UTC 2007
Paolo Bonzini wrote:
>> VW solved the problem too, they use a message (collection growTo:
>> newSize) or something like that instead of (collection class new:
>> newSize).
>
> I've wondered though if it's necessary. The adapter solution is better
> in my humble opinion, because it is stupid that the stream imposes a
> growing policy to a growing collection, and because an "adding stream"
> would not need a final copy when calling #contents.
True, however, the adapter solution makes it very difficult to create
streams that work on both sequenceable and arrayed collection. For
example, is GZipWriteStream a subclass of WriteStream or
AddingWriteStream? Do we need two classes, one for sequenceable and one
for arrayed collections? Does any new stream require an extra method in
sequenceable/arrayed collection (so that clients don't have to know
about what exactly they are dealing with)? All in all, I find the VW
solution of having a single polymorphic way that streams can use to
access both arrayed and sequenceable collections vastly preferable.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|