There are a few reasons for this
- You need to expose every field that you want serialized as a public property/field. What a joy to that your object model does not hide anything ;)
- XmlSerializer does not work for Dictionaries (who would have a dictionary in their api?)
- XmlSerializer does not work for List of lists and some such (rare, but u will sometimes run into this landmine if you try to solve 2 creatively).
- You can leak a few dlls (and due to way windows virtual memory works, you will lose atleast 64k of virtual space for every dll) on every serialization attempt if you are not careful (blogged about his before)
- Many useful framework classes are not xml serializable (e.g. Regex)
BTW, the DataContractSerializer with dotnet 3.0 solves all these problems and it is an infinitely better beast.
No comments:
Post a Comment