OK, I’ve had it with the serializers in .NET.
All of them are lacking atleast some features that I need.
XML serializer can not handle circular references.
Soap serializer can not handle generics.
Binary serializer is decent but will crash and burn if your class schema change (this applies to all the others to).
And then we have all those WCF thingies, but they require contracts/interfaces.
So I got tired of this mess and I’ve finally rolled my own XML serializer.
My serialzier supports:
- Circular references
- Generic lists
- Error resolution
- Clean XML format
The error resolution works by raising events so that the developer can either ignore errors or resolve fields and types himself.
I have also added a default resolver that will handles missing “backing fields”
I’m using this serializer in Caramel Studio for the save file format.
So even if the model for my Caramel classes changes, you will still be able to load the files and you will only lose some settings.
The serializer is now part of my Alsing.Core project that can be found in the SVN repository at my google code site:
http://code.google.com/p/alsing
So what’s NOT supported then?
Currently lists will be treated in a special way, so only content of lists is serialized, any other custom state in a list will not be serialized.
I will add support for this later.
Multi dimentional arrays are not supported yet.
Work in progress:
I will make it possible to substitute types on serialization and deserialization, so that you can serialize graphs of proxy objects and then deserialize the same graph again by letting your proxy factory create the instances for you.
//Roger
Added. Nice work on this one. Btw, my blog is dofollow, stop by and grab a link. Bompa
Great info – keep up the great work.
tar du aldrig ledigt :P
sounds intresting im gonna try it.
Love you man :x exactly what I am looking for. Built-in serializers sucks!
By the way, you rock man! Thanks so much for the code!
Alsing.Serialization project not completed into repository at http://code.google.com/p/alsing. The folder not found : MetaObjects, Managers and Facilities. Please helpme, I’m intented compiling to CaramelStudio into VS2010. Thanks for your advanced!
JM