Hi Christophe, Sorry for the delay, I was on holiday.
On 15 Jul 2014, at 14:46, Christophe Demarey <[email protected]> wrote: > Hi, > > I read the STON paper and the STON chapter in EnterprisePharo but I did not > find answers to some questions: > • how do you tell STON to not serialize some variables of an object? To achieve that you have to write your own encoding by overwriting #stonOn: and #fromSton: (see implementors). > • is there a way to avoid the class tag? What I mean is that I would > like a synthetic STON String. If a STON entry has a class tag, STON knows > which class to instantiate. This class may also know which classes to > instantiate for its i-var. In this case, the class tag may be omitted. Maybe > I should redefine fromSton;, but in this case, is it possible to avoid a > manual parsing of the string? No, that is not possible. I fail to see how this would be useful or needed, but maybe I just don't understand your question. > • is there a way to do an alias for an i-var (just like for the class > name)? To achieve that you have to write your own encoding by overwriting #stonOn: and #fromSton: (see implementors). > • is there a way to skip the serialization of an i-var if its value is > nil (or an empty collection)? Overwrite #stonShouldWriteNilInstVars for your object to return true. For empty collections there is no provision. > Regards, > Christophe. Sven
