开发者

Is a JSON serialization deserialization library of any use

It just strikes me that What can JSON.net library do in special that a JavaScriptSerializer class does not?

  1. Is it worth including in a large enterprise application that talks through SOAP webservices and javascript?

  2. What performance gain/ development gain i get by including such libraries in the project?

  3. Are there similar li开发者_StackOverflow中文版braries that aid in object serialization/ deserialization faster, better and smarter?


  1. Yes it is. Absolutely. Just because something comes by default with the .NET framework built by Microsoft it does not mean that it's the best thing to use. The size of an application, nor where it's deployed, in my view is hardly a determining factor of whether a library like JSON.net should be used. Look at your own needs and use that as the driver, not the size of your app.
  2. Substantial. JSON.net is really fast, has a lot more features and is a much "friendlier" API to use. I wouldn't hesitate recommending it for use in any application. I have personally used it in Enterprise applications, open source libraries and WP7 games.
  3. There are lots of similar libraries. JsonFx is one. Is it faster, better and smarter? Yes and no, yes and no, and yes and no respectively. There is no golden bullet for this kind of thing. You should investigate your needs and figure out which one suits you. I can almost guarantee that if you're happy to use the out-of-the-box JavascriptSerializer you won't (can't!) be disappointed with the features and speed of either of these other options.

HTH.


I don't know too much details about the libraries. One thing I needed to do was serializing the Enums.If I use default serializer it will serialize the value of the enum ,but I wanted to get the name. So I did this using Newtonsoft.Json (JSON.net)like this,

[JsonConverter(typeof(StringEnumConverter))]
public  SearchResultType SearchResultType { get; set; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜