XML Serialization vs Custom XML Serialization
Every project that I'm starting i have the same question when i have to decide the XML serialization for some object. Should I use XML Serialization or Custom Serialization ?
The first projects that i developed i defined a IMyXmlSerializable with 2 methods FromXml and ToXml. After I was very happy with my primary definition exploring the framework help i found the .NET XML Serialization. I felt like a stupid and said "I reinvent the wheel".
However .NET XML Serialization is not the paradise, if your object definition is complex and big, if you wanna serialize some private member, if you wanna serialize complex relationships between objects saving size and time, in this cases I still prefer Custom Serialization.
Interesting info from SharpDevelop( Dissecting a C# Application) :
"The version that used serialization took up 90 MB hard disk space and over 15 minutes...."
"... the routine that was without serialization takes only around 20 MB and builds the database in 1 minute on the same machine."
Right now I feel better :-)