GWT RPC或使用Javascript覆盖的请求生成器? [英] GWT RPC or Request Builder using Javascript Overlay?

查看:90
本文介绍了GWT RPC或使用Javascript覆盖的请求生成器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GWT RPC是由gwt提供的一种机制,用于在客户端和服务器之间进行通信。还有一个请求生成器,通过它你可以连接到服务器。



你应该建议一个基于gwt的应用程序的机制,请说明原因好的..

解决方案

我认为GWT RPC是最有可能的方式。



我可能对此有错,但我相信gwt RPC解决方案建立在RequestBuilder之上。它在RequestBuilder之上添加了诸如Java类的自动序列化之类的功能,并使来回发送数据变得非常简单。此外,gwt RPC可能是目前最流行的解决方案,因此您可以通过教程和博客文章的形式找到更多支持。



我尝试了使用RequestBuilder编写我自己的客户机/服务器机制,这是可行的,但最终,gwt RPC已经完成了我在自定义解决方案中实现的所有工作,因此我决定回到它。

我可以看到需要使用RequestBuilder的唯一原因是,如果您需要在gwt RPC内部不能工作的地方执行某些操作。例如,在一个应用程序中,我需要使用jsonp从我的客户端代码通信到第三方rest API,这是我无法控制的。在这种情况下,我无法使用gwt rpc,因为我无法访问服务器组件。

GWT RPC is a mechanism provided by gwt to communicate between client and server. Also there's a Request Builder, through which you can connect to the server.

Which mechanism would you recommend for a gwt based app, and please state the reasons to do so as well..

解决方案

I'd think GWT RPC is most likely the way to go.

I might be wrong about this, but I believe the gwt RPC solution is built on top of RequestBuilder. It adds functionality on top of RequestBuilder such as automatic serialization of java classes and makes it pretty trivial to send data back and forth. Also, gwt RPC is probably the most popular solution at this time and so you'll find a lot more support in the form of tutorials and blog articles.

I tried "rolling my own" client/server mechanism using RequestBuilder, and it's doable, but in the end, gwt RPC already does everything I needed to implement in my custom solution so I decided to go back to it.

The only reason I could see needing to use RequestBuilder is if you need to do something outside the lines that doesn't work inside gwt RPC. For example, in one application, I needed to communicate using jsonp from my client code to a third party rest api that I didn't have control over. In this case, I wasn't able to use gwt rpc because I didn't have access to the server component.

这篇关于GWT RPC或使用Javascript覆盖的请求生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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