开发者

Google's Protocol Buffers in c#

We are looking at using Google's Protocol Buffers to handle serialization between a c++ application and a c# application via networking.

My question is, I've found a couple of different verisions for c#. Both look pretty good, however, does anyone know what is different (if anything) between the two

  1. protobuf-net
  2. jskee开发者_如何学Ct / dotnet-protobufs


Sure; dotnet-protobufs is a port of the java version, so shares a very similar API and approach to the core google implementation; code-gem, immutability, etc.

Protobuf-net is byte compatible, but is a complete from-scratch re-implementation, following standard .NET idioms - so is familiar to users of XmlSerializer etc. It also works against mutable objects (and immutable depending on the setup, and structs in v2), and has optional hooks for WCF, remoting, etc.

Both can work from .proto (arguably dotnet-protobufs is better at this than protobuf-net); but protobuf-net can work against existing .net poco/DTO etc without .proto or any codegen.

Additionally, protobuf-net offers things like inheritance support, but you might not choose to use that in your scenario as it doesn't map as easily to .proto definitions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜