[Mono-dev] Re: Serialization strategies for compatibility.

Miguel de Icaza miguel at ximian.com
Wed Jun 7 01:07:45 EDT 2006


Hello!

> I've implemented 2.0 serialization a couple of days ago. It still
> needs some unit tests and a complete interoperatibility test.
> I'll finish them by the end of the week, if I'll not discover
> that the reflective approach of calling the new hooks is
> too slow ... (see below).

That is fantastic, I was going to put that on my todo list.

I saw the bug report with the patch (78594)

> > 	* The new hooks do not cope well with differently-named fields.
> 
> Indeed, it's a bit clumsy:

I guess am hoping that we will reach the consensus that "Sprinkling
ISerializable on [Serializable] classes that we cant make compatible is
OK".

> I'd go for an extra attribute that could be attached on
> the type (like [Serialized]), and that expects the same
> semantics like ISerializable (method GetObjectData and
> ctor(SerializationInfo, StreamingContext)).

These lookups are also fairly expensive.

In fact the runtime actually "fakes" [Serializable] (well, they call
them synthesized attributes, or something like that), and the
"Serializable" bit is actually turned into a bit in the method
definition for fast lookup.

Miguel.



More information about the Mono-devel-list mailing list