[Mono-list] Recursive XML serialization? XML serialization of cyclic objects?

Rodolfo Campero rodolfo.campero at gmail.com
Sat Jan 13 09:15:15 EST 2007


Hi,

2007/1/13, "Andrés G. Aragoneses [ knocte ]" <knocte at gmail.com>:
[...]
> implement custom serialization for each of my classes. In fact, what I
> want to be able to do is to XMLserialize my cyclic objects without
> writing more code.

If the only thing you need is to serialize cyclic objects to XML, you
can consider the following. Even though the solution I'll propose is
not currently available, I think it's possible to get there relatively
quickly.

The XMI [0] standard, proposed by the OMG [1], allows XML
serialization of objects with cyclic references. The nUML project [2]
provides a library with services for XMI serialization, which is
currently used by the UML and MOF libraries.

My idea for the next version of the library was to write a code
generator, which would generate C# code for DTOs and a serializer
class from a MOF definition. This project is currently halted due to
lack of spare time (it's 90% completed aprox.), but if you're willing
to take a look I can upload it.

A related project that can be undertaken is a generator of MOF
definitions from C# assemblies. The generated file could be used to
generate an XMI serializer for existing libraries.

Regards,
Rodolfo

[0] http://www.omg.org/technology/documents/formal/xmi.htm
[1] http://www.omg.org/
[2] http://numl.sourceforge.net/index.php/Main_Page


More information about the Mono-list mailing list