Storing morphs displayed in the world in a GOODS db

John Pierce john.raymond.pierce at gmail.com
Mon Sep 27 16:12:36 UTC 2004


> Yes, any time you end up passing a proxy into a prim you're gonna have
> trouble.

Yeah, I see that now, but gosh, this is a big implementation detail (I
call them pipes) jutting up through the floor.  The real trouble is
that I don't know where these things will come out of the woodwork. 
Yeah, I can avoid doing this for BitBlt in the future, but what other
prim will be my downfall with respect to proxied objects in the
future?

> I can't think of a great way of dealing with this in the general case.
> In this case, you could override Color class>>goodsFieldDescriptors to
> not include a descriptor for the cachedBitPattern (so that it won't get
> written to or read from GOODS).

Of course, it isn't really a problem with the Color class.  It is more
a problem with one of its instVars (cachedBitPattern).  So fixing it
for Color gets me unstuck, but leaves the bigger question about Bitmap
instances that might be proxied.

> Slightly more general would be to add
> a field type something like KKAutoloadReferenceField that would always
> bring the full object in right away, rather than using a proxy, and
> mark cachedBitPattern as having this field type

What implications would this have when committing changes at a later
time?  It seems like you are, in essence, making the cachedBitPattern
instVar an immediate value (sort of).

>  this would probably
> require adding an #allowProxy flag to KKRequestObject that would be set
> to false by KKAutoloadReferenceField>>referenceAt:, and then checked by
> KKDatabase>>objectForKey:.

So would class-side of Color somehow participate in this algorithm to
declare that cachedBitPattern was one of these
KKAutoloadReferenceFields (or no proxy permitted on this instVar)?

> Another really specific solution would be to add Color as a new
> immediate value type.  We did this for Character when we were having
> very similar problems a while back.  Since object references in GOODS
> are 6 bytes, we have plenty of tag bits to play with...

Tell me more.  How can I do this just to play with the idea?  Do I
need to be aware of the other immediate values and pick a number that
represents my color class?  I assume I have to implement writing the
tagged field in this case.

Regards,

John

-- 
Three failures denote uncommon strength. A weakling has not enough
grit to fail thrice. -- Minna Thomas Antrim



More information about the Squeak-dev mailing list