I think the throwing of an error you need anyway in case something goes wrong. But I would welcome a support in the serializer to plug in a class shape changer. Most of the time I do format changes I know exactly what to convert and so it might be a good option to desribe it together in one object. This object would be different for every oldversion-newversion tuple. In gemstone it is different because there are class versions. Each class can have a migrateTo: method that deals with it.Btw, what deserializer does, if it discovers that instance of some
class, which you want to bring to life from storage
now has its format changed?
suppose that when saving graph, some class has inst vars 'a b c'
but then you changed the class definition and its inst vars now 'a d e'
?
I think it is not a responsibility of serializer to deal with that
(there should be a higher level layer which can handle instance
migration),
while serializer just reports an error that it can't reify an object
because its original class are either gone or changed format.
On 2 June 2011 14:51, Norbert Hartl <norbert@hartl.name> wrote:Am 02.06.2011 um 14:31 schrieb Mariano Martinez Peck:Thanks Norbert. Now I could successfully run benchmarks for SIXX and comparewith Fuel. But that's not really fare because we are comparing a text basedserializer against a binary one.It is interesting anyway. I like to know if it is 20 times faster or evenmore. On the other hand it is not fair either. I don't know fuel but I thinkit platform dependent, right? So it is not fair the other way round becauseyou compare a cross-platform serializer with a platform-dependent one ;) Ithink these are the categories that people think about when the are about tochoose what util to use.NorbertMarianoOn Thu, Jun 2, 2011 at 12:14 PM, Norbert Hartl <norbert@hartl.name> wrote:Am 02.06.2011 um 11:42 schrieb Mariano Martinez Peck:serialize: anObject on: aStream| sws |sws := SixxWriteStream on: aStream.sws nextPut: anObject.sws close.serialize: anObject on: aStreamanObject sixxOn: aStreammaterializeFrom: aStream| srs objects |srs := SixxReadStream on: aStream.objects := srs contents.srs close.^ objectsmaterializeFrom: aStream^ Object readSixxFrom: aStreamNorbertIs that correct or I am doing it wrong? All I want to do is to serializea graph into a stream.The stream I am using is or this:(FileDirectory default forceNewFileNamed: 'Bench')or(RWBinaryOrTextStream on: '')I am not sure if I should be doing a #nextPut: or a #nextPutAll:. I mean,sometimes anObject is a collection and sometimes it is not. So, which oneshould I use?ThanksMariano--Marianohttp://marianopeck.wordpress.com--Marianohttp://marianopeck.wordpress.com
--
Best regards,
Igor Stasenko AKA sig.