开发者

What is a good communication layer for both Java and C#?

I would like my newer C# 2.0 application to talk to my older Java 1.4 application 开发者_Go百科(can't change versions, sorry). What are my options?

I think that using shared memory would give me better performance, but on the other hand, if I use a network protocol then the architecture would be more flexible. So I'm looking to weigh up both options to see which has the biggest pay off.

I've used XML-RPC implementations that are dog slow, but I assume that was just a bad implementation, and not the actual protocol. Would I be better off going with a lower-level protocol? I've used Google's protobuf before in C++ and Python (over plain old sockets) but I'm not so sure that it's available for Java and C# -- is there anything similar available for the languages I'm using?

I'm looking for the best performance that I can possibly get, but, I'm working with objects and inheritance hierarchies that I'd like to serialize (protobuf is a good example of how this can be done). So, sadly, just sending a simple string over sockets isn't really feasible.


Aha, there's actually C# versions of protobuf!

  • http://code.google.com/p/protosharp/
  • http://code.google.com/p/protobuf-csharp-port

... and protobuf has support for Java anyway.


you might also consider JSON as serialization for your objects, much lighter than XML but same capabilities to represent object hierarchies and many libraries are available.

for the communication bus however, i would recommend network since it gives better flexibility.

IMHO,your performance bottleneck is due to serialization/deserialization more than communication bus itself.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜