I need to serialize complex objects in my project and put them in a database. I’d like to serialize them using XML for obtain a easier debugging of my application.
My case is very similar to what is described in this article: http://geekswithblogs.net/SoftwareDoneRight/archive/2008/01/16/how-to-serialize-an-interface-using-the-xmlserializer.aspx
So I have an object containing a Property which type is defined by an interface. Then I have different concrete types implementing it.
Following the article approach, using the XmlInclude attribute, I obtain a strong coupled solution, but my application is structured to use a plug-in approach, so I could have so many implementations as I want of my interface.
Is there a way to solve my issue using xml serialization, or I have to go with binary serialization?
Read your post from geekswithblogs.net. I will suggest you to do the binary serialization. It is easy to implement and to maintain (unless and until you change the qualified name of the class). Binary Serializer serializes private members too.
How to use binary serializer