Goods: Problems with characters and primitives

Adrian Lienhard alienhard at netstyle.ch
Sun Jul 11 10:22:31 UTC 2004


Hi,

I've come across a problem concerning storing characters in goods and 
another issue concerning primitives:

When you store a character in the DB and then load it again, #= will 
not return true for the same character. The problem is that  the goods 
client creates the character object on its own when loading in again 
without taking the unique object from the character table which leads 
to the problem that the primitive in #= (which tests characters on 
object identity) fails. My current solution is to implement the class 
CharacterDescriptor with:
objectFromStream: aStream
	^Character value: (super objectFromStream: aStream) hash

Another problem I encountered was the following: When writing data from 
the DB on a stream the primitive in WriteStream>>nextPut: failed. I 
assume the problem is that there was a goods proxy object passed as 
parameter. Since with normal message sends the proxy always resolves 
correctly to the actual object by the DNU trick - but this fails with 
primitives. For the moment, I just send #yourself at the right place to 
the objects before passing them to the stream but I don't have a 
general solution. Anyone?

Adrian
___________________
Adrian Lienhard
www.adrian-lienhard.ch
www.netstyle.ch




More information about the Squeak-dev mailing list