开发者

Benefits of serializing an object instead of using xml

开发者 https://www.devze.com 2023-01-30 10:23 出处:网络
Right my my application saves its objects as xml. The开发者_如何学JAVA reason why I am considering serializing the objects is for a speed gain. Are there any other benefits of serializing? There\'s on

Right my my application saves its objects as xml. The开发者_如何学JAVA reason why I am considering serializing the objects is for a speed gain. Are there any other benefits of serializing?


There's one downside that has nothing to do with performance: You can't retrieve the serialized data if you ever change the underlying objects. If the data is long-lived, you could be setting yourself up for a rigid object model.

XML the advantage of leaving open the possibility of "duck typing"; so does JSON, and it's lighter than XML.


give json a try. its more lightweight.

object serialisation has given me many headaches in the past particually in an ever changing domain model

0

精彩评论

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

关注公众号