这篇文讲得不错,可惜居然要翻墙。
摘录:
The XmlSerializer has been in .Net since version 1.0 and has served us well for everything from Remoting, Web Services, serializing to a file, etc. However in .Net 3.0 the DataContractSerializer came along.? And all of a sudden a lot of guidance suggests that we should use it over the old tried and true XmlSerializer. Wcf even uses this as the default mechanism for serialization.? The question is, “Is it really better?”.? The verdict is yes, and no.? Like most things it depends on your implementation and what you need.? For Wcf, you should prefer to use the DataContractSerializer.? If you need full control over how the xml looks though, you should go back to the XmlSerializer.
Lets look at the both of these in detail and leave it up to you to decide which is best for your implementation.? Here are a few of the advantages and disadvantages of each of them:
。。。。。。。。
本文探讨了.NET中XML序列化器与DataContract序列化器的优缺点。XML序列化器自.NET 1.0以来便存在,而DataContract序列化器在.NET 3.0中引入。对于WCF应用,推荐使用DataContract序列化器;若需完全控制XML输出,则XML序列化器更佳。
908

被折叠的 条评论
为什么被折叠?



