SmartRefStream broken?

Lex Spoon lex at cc.gatech.edu
Thu Nov 16 11:15:42 UTC 2006


Aaron Reichow <revaaron at bitquabit.com> writes:

> On Nov 14, 2006, at 4:02 PM, Andreas Raab wrote:
> 
> > Benjamin Pollack wrote:
> >> Is there a reason why SmartRefStream has such a radically
> >> different interface than ReferenceStream, even though it's a
> >> direct subclass?
> >
> > Yes. The reason is that you shouldn't use SmartRefStream the way
> > you're using it. The "correct" way is using
> > #fileOutClass:andObject: like here:
> 
> That might be preferred way to use it, but it isn't any excuse for
> the problem- poor design.  What works with ReferenceStream doesn't
> work with its subclass, SmartRefStream. Regardless of what might be
> preferred, it isn't unnatural to take what works fine with
> ReferenceStream and try to apply that to SmartRefStream, Many of the
> examples I've seen throughout the image and other applications (e.g.
> ScriptManager) use it in the way I wrote in my original post.  No
> excuse for it, but at least it's easily fixed!

I have always used the mixed style that Benjamin describes: use
SmartRefStream directly for fileout, and use fileInObjectAndCode for
fileIn.  I remember this incantation being tricky to figure out.


I agree that at the least it would really help if the documentation
within class SmartRefStream were updated to include common use cases.
Right now the class comment is huge but it does not include basics
like (a) when do you use it and (b) what is the standard idiom (which
I guess is what Andreas wrote).  Are there any takers from this thread
to write a little comment-adding changeset?


-Lex





More information about the Squeak-dev mailing list