[Mono-list] serialization

Lawrence Pit loz@cable.a2000.nl
Thu, 25 Apr 2002 02:06:59 +0300


> Duncan wrote a tool (mcs/tools/serialize.cs) that helps you with this.
> Basically it tells you what fields must be serialized and the key names
> that you have to use.

Is the plan to only be compatible with MS.Net with regards to XML and SOAP
serialization or also on a binary level ?

The first is quite poorly implemented in MS.Net, a lot of objects tagged as
[Serializable] simply don't serialize with the XmlSerializer.

The latter is hard, if not practically impossible, to achieve I think. I
have seen this before with Kaffe for Java, it simply doesn't work (though
I'm not sure if they ever had the intention to be binary compatible). I
haven't seen any dotnet specification of the binary format dotnet objects
are serialized to, does it exist? Does anyone know what the exact algoritm
is? If not, how sure are you that microsoft isn't writing some sort of
hashcode based on the number of public fields, private methods, inner
classes, etc. into the binary stream? How sure are you they aren't signing
their serialized objects using some private key? Matching the key names only
might not be enough, it could be that the structure of a class is also
important. What's more, what if Microsoft is serializing private fields into
the binary stream that make no sense to mono (as they haven't been specified
in the documentation), but do for some internal reason to MS.Net? What if
that private field is of a type that is a private class of MS.Net of which
the specifications have not been released to ECMA?


Greets,
Lawrence