GWT-RPC 与 HTTP 调用 - 哪个更好? [英] GWT-RPC vs HTTP Call - which is better?

查看:26
本文介绍了GWT-RPC 与 HTTP 调用 - 哪个更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估使用 GWT-RPC 和 HTTP 调用.

I am evaluating if there is a performance variation between calls made using GWT-RPC and HTTP Call.

我的 appln 服务托管为 Java servlet,我目前正在使用 HTTPProxy 连接从它们获取数据.如果这能带来性能提升,我希望将它们转换为 GWT-RPC 调用.

My appln services are hosted as Java servlets and I am currently using HTTPProxy connections to fetch data from them. I am looking to convert them to GWT-RPC calls if that brings in performance improvement.

我想知道每个人的优缺点...

I would like to know about pros/cons of each...

还有关于衡量异步调用性能的工具的任何建议...

Also any suggestions on tools to measure performance of Async calls...

[一篇关于各种服务器通信策略的好文章,可以与 GWT 一起使用.]

[A good article on various Server communication strategies which can be employed with GWT.]

推荐答案

我写了问题中提到的那篇文章(感谢链接!).

I wrote that article mentioned in the question (thanks for the link!).

与往常一样,答案是视情况而定".我使用过 GWT-RPC 和 JSON.

As always, the answer is 'it depends'. I've used both GWT-RPC and JSON.

如上所述,GWT-RPC 允许通过网络传输 Java 对象(有一些限制)时具有一定的生产力.一些逻辑可以共享,GWT 负责编组/解组您的对象.

As outlined above, GWT-RPC allows for some serious productivity in shipping java objects (with some limits) over the wire. Some logic can be shared, and GWT takes care of marshalling/unmarshalling your object.

JSON 允许其他非 GWT 客户端进行跨域访问和使用.您可以使用覆盖类型,但不能共享任何行为(如验证).与 GWT-RPC 不同(我上次查看),JSON 也可以轻松压缩和缓存.

JSON allows for cross domain access and consumption by other, non GWT clients. You can get by with overlay types, but no behavior (like validation) can be shared. JSON can also be easily compressed and cached, unlike GWT-RPC (last time I looked).

由于我们不知道有效负载是什么,因此很难给出性能建议.我建议(再次,正如上面有人所做的那样)测试自己.

Since we have no idea what the payload is, performance recommendations are hard to give. I'd recommend (again, as someone does above) testing yourself.

这篇关于GWT-RPC 与 HTTP 调用 - 哪个更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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