BinaryFormatter的替代 [英] BinaryFormatter alternative

查看:196
本文介绍了BinaryFormatter的替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我逛了BinaryFormatter的替代/更换。

I am shopping for a BinaryFormatter alternative/replacement.

目前的问题我有BinaryFormatter的(和替代品应该解决这个问题)是
1)向后兼容性(可系列化使用较早版本的反序列化类)
2)尺寸
3)速度

The current issues I have with BinaryFormatter (and the alternatives should address this) are
1) backwards compatibility (can deserialize Classes serialized using an earlier version)
2) size
3) speed

我已签出AltSerializer看起来速度还行,一些相互矛盾的报告,但是看起来它支持向后兼容性。

I have checked out AltSerializer which looks ok, some conflicting reports on speed however it looks like it supports backwards compatibility.

我也看了一下 protobuf网它看起来棒极了,除了在这个阶段需要的工作很多,你必须定义所有的.proto文件。

I also looked at protobuf-net which looks fantastic except at this stage it would require alot of work as you have to define all the .proto files.

也许有人使用上述任何一种或别的什么东西会照顾发表评论。

Perhaps someone using either of the above or something else would care to comment.

推荐答案

我后来了解到,protobuf网将尊重[DataContract]和[的DataMember]属性(无需.protos),所以如果你的类是WCF就绪或者你想与上述属性装点他们,那么你可以为你的类使用protobuf网开箱即用的。

I have since learned that protobuf-net will respect the [DataContract] and [DataMember] attributes (no .protos required) so if your classes are WCF-ready or you want to decorate them with aforementioned attributes then you can use protobuf-net out of the box for your classes.

有些工作显然需要来装饰您的所有课程(protobuf的V1的需要这一点),但是我明白V2将能能够建立模型进行的未装饰类。

Some work is obviously required to decorate all your classes (v1 of protobuf requires this) however I understand v2 will be able to able to build the model for your undecorated classes.

这篇关于BinaryFormatter的替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆