简体   繁体   English

是否有任何适用于C ++和GWT并支持结构多态性的数据绑定解决方案?

[英]Are there any data-binding solution that works in C++ and GWT and supports structures polymorphism?

I expect it should share a common description, like XmlSchema or IDL and should generate classes for target language. 我希望它应该共享一个通用的描述,例如XmlSchema或IDL,并且应该为目标语言生成类。

I found Thrift and it's really nice solution, but it doesn't support structures polymorphism. 我发现Thrift确实是一个很好的解决方案,但是它不支持结构多态。 I would like to have collections of base class objects, where I could place instances of subclasses, serialize this and deserialize at the opposite side. 我希望有一些基类对象的集合,可以在其中放置子类的实例,对其进行序列化并反序列化。 Some mechanism of polymorphic behavior support, like Visitor, would be a perfect. 诸如Visitor等多态行为支持机制将是完美的。

Does anybody know something suitable for these requirements? 有人知道适合这些要求的东西吗?

I would suggest trying Protocol Buffers. 我建议尝试协议缓冲区。 It is a Google originated technology so I would imagine it is well supported by C++ and GWT. 它是Google起源的技术,因此我想它会得到C ++和GWT的良好支持。

http://code.google.com/apis/protocolbuffers/ http://code.google.com/apis/protocolbuffers/

As mentioned, something like Protocol Buffer s would definitely be your best bet. 如前所述,类似Protocol Buffer的东西绝对是您最好的选择。 It supports C++ and there are two separate projects that support GWT: protostuff and protobuf-gwt . 支持C ++,并且有两个单独的项目支持GWT: protostuffprotobuf-gwt

There are many comparisons between Protocol Buffers and Thrift, so if you're looking to use Thrift, it's possible to integrate with GWT as well, through the gwt-rpc-plus project . 协议缓冲区和Thrift之间有许多比较,因此,如果您想使用Thrift,也可以通过gwt-rpc-plus项目与GWT集成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM