GWT RPC or Errai or RequestBuilder?

234 views
Skip to first unread message

Mohammed

unread,
Feb 9, 2015, 7:41:03 AM2/9/15
to google-we...@googlegroups.com
Hi,
I created big application using GWT and am using RequestBuilder to communicate with the server.So what is the best way for communicate to server from client.
i)RequestBuilder
ii)GWT RPC
iii)Any other approach(GWT Errai).


I came to know that using GWT RPC is huge pain , so,what are the drawback of using GWT RPC?what is the best approach?Please give me suggestion?

Ümit Seren

unread,
Feb 9, 2015, 9:02:03 AM2/9/15
to google-we...@googlegroups.com
It depends. 

RequestBuilder is basically a wrapper around XMLHTTPRequest. It can be used but IMHO I would use one of the high level abstractions which are: 

GWT RPC is the easiest to get started but you will have stronlgy coupling between backend and frontend and there are some pitfalls (if you update the RPC code on the backend, you have to cope with seralizations errors from clients with outdated versions of the frontend code) you have to be aware of.  

RequestFactory is another choice which supports transferring only deltas (things that changed). This is quite handy for CRUD like applications. However like RPC you will have strong coupling between backend/frontend. 
Both GWT-RCP and RF works if you use Java on the backend (theoratically you could use it with another language on the backend, but you would have to implement the backend logic yourself). 

Errai provides various communcation protocols (EventBus, JAX-RS, RPC). Again this will lead to a stronger coupling between backend and frontend (maybe with the exception of JAX-RS). But In general Errai is quite easy to use. 

Finally you could use a Restful approach. This is best if you want to want to de-couple your frontend from your backend (For example if you want to use the same backend from other non-GWT clients: Android, etc).This might be more involved than the above solutions (although RestyGWT provides a nice abstractions) but I would recommend it as it provides a lot of flexibility and you can evolve your backend independently from your frontend. 

Mohammed Sameen

unread,
Feb 9, 2015, 12:53:08 PM2/9/15
to google-we...@googlegroups.com
Thanks for your reply..I would like know more about the limitation of using GWT RPC?

Danilo Reinert

unread,
Feb 11, 2015, 8:56:54 AM2/11/15
to google-we...@googlegroups.com
Hi Mohammed. 

If you're looking for a replacement for RequestBuilder, which is a low-level approach for requesting, with all its flexibility, you would better go with a high level http client api.

To fulfill exactly this need, I developed Requestor, which is really an HTTP Client API for GWT.

I strongly recommend you to try it, since it offers everything you need to communicate via HTTP out of the box and many other features for a good HTTP Client API. (I've modeled it based on successful APIs from the Python, JS and Java communities)

You won't need to worry about json serialization (many alternatives are available for it), binary data manipulation, authentication, and many other things.

The API has a very elegant idiom and you find it simple and intuitive to make requests (a comparison with RequestBuilder is shown at the project home).

Cheers.

Manuel Carrasco Moñino

unread,
Feb 19, 2015, 10:35:18 AM2/19/15
to Google-Web-Toolkit
FYI, Gwtquery Ajax is almost the same than Requestor, it uses the jquery sexy api and suppors json and xml serialization/deserialization and databinding among other features like data forms etc. It has a jvm implementation so as you can use gquery Ajax in your tests or in server side.



- Manolo


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages