RF and REST

267 views
Skip to first unread message

cha...@gmail.com

unread,
Jul 3, 2012, 5:24:17 AM7/3/12
to google-we...@googlegroups.com
Please have anyone of you been successful with REST on a GWT project? What api's did you use. We are in the design stage of an app, we love GWT but want to liberate the architecture such that we can use the same server code for the clients (GWT and JQuery mobile). I don't know if RequestFactory (for the GWT client) can play nicely with a REST back end and we are not even sure how to go about it. Some googling revealed Restlet (which I think couples our server code to GWT) and Apache CXF. Any hint on which to use, and how to go about it? Big thanks.

Sent from my BlackBerry® wireless handheld from Glo Mobile.

Chris Price

unread,
Jul 3, 2012, 6:04:30 AM7/3/12
to google-we...@googlegroups.com
RestyGWT is worth considering - http://restygwt.fusesource.org/

On Tue, Jul 3, 2012 at 10:24 AM, <cha...@gmail.com> wrote:
> Please have anyone of you been successful with REST on a GWT project? What api's did you use. We are in the design stage of an app, we love GWT but want to liberate the architecture such that we can use the same server code for the clients (GWT and JQuery mobile). I don't know if RequestFactory (for the GWT client) can play nicely with a REST back end and we are not even sure how to go about it. Some googling revealed Restlet (which I think couples our server code to GWT) and Apache CXF. Any hint on which to use, and how to go about it? Big thanks.
>
> Sent from my BlackBerry® wireless handheld from Glo Mobile.
>
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>

Thomas Broyer

unread,
Jul 3, 2012, 9:06:53 AM7/3/12
to google-we...@googlegroups.com, cha...@gmail.com

On Tuesday, July 3, 2012 11:24:17 AM UTC+2, chalu wrote:
Please have anyone of you been successful with REST on a GWT project? What api's did you use. We are in the design stage of an app, we love GWT but want to liberate the architecture such that we can use the same server code for the clients (GWT and JQuery mobile). I don't know if RequestFactory (for the GWT client) can play nicely with a REST back end and we are not even sure how to go about it.

RequestFactory is inherently RPC-oriented, so no it won't "play nicely with a REST backend".

On the client side, it comes with 2 "dialects": RequestFactory's own protocol (to talk to the RequestFactoryServlet), and JSON-RPC (to talk to any JSON-RPC endpoint). You could use that second one to ease reuse of the same endpoints by other clients (there probably is a jQuery plugin for that).
However, the JSON-RPC dialect is not really finished yet (some limitations for now) but should nevertheless be usable (I believe Google is using it). You'll lose some features too, compared to the RF dialect (everything related to EntityProxy vs. ValueProxy; basically, only use ValueProxies).

Some googling revealed Restlet (which I think couples our server code to GWT)

Not at all.
Restlet was created long before GWT, and they then added GWT support on the client-side, but the goal is to be a truly RESTful framework, where it doesn't matter what your clients and servers are, only what resources they expose, with which representations, and responding to which verbs.
Put differently, anything that would bind your client and server cannot be said to be RESTful. If you want to make true "REST resources", then look for something else (Restlet for example, or JAX-RS)

and Apache CXF.

I don't know Apache CXF so I can't comment.

There's also JAX-RS to easily build REST endpoints.
And for client-side code, as far as GWT is concerned, there's RestyGWT, Restlet, or Errai (JAX-RS; see http://errai-blog.blogspot.fr/2011/10/jax-rs-in-gwt-with-errai.html ), among many others.
 
Any hint on which to use, and how to go about it? Big thanks.


May I question whether you want to make a "true" REST backend, or simply don't want to be tied to any "proprietary protocol"? that would open a bunch of possibilities, such as JSON-RPC.

Raphael André Bauer

unread,
Jul 3, 2012, 9:25:30 AM7/3/12
to google-we...@googlegroups.com, cha...@gmail.com
+1 for restygwt. Has never let us down - even in very large projects.

Cheers,

Raphael
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/g8pNDWiRMb0J.
>
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.



--
inc: http://ars-machina.raphaelbauer.com
tech: http://ars-codia.raphaelbauer.com
web: http://raphaelbauer.com

cha...@gmail.com

unread,
Jul 3, 2012, 9:51:59 AM7/3/12
to Raphael André Bauer, google-we...@googlegroups.com
Thanks for the quick and helpful replies. Our goal is to build a true RESTful back-end (to serve as an API) and then allow clients (GWT app, JQuery mobile app, CLI / API calls e.t.c) interact with the exposed methods/resources from the server in a simple (RESTful) way. Have not really looked at restygwt, but am wondering if it will allow us develop the rest back end without tying us to gwt, I will google more but am yet to find a comprehensive restlet (server-side) example. So we don't know how to start. Thanks again!

Sent from my BlackBerry® wireless handheld from Glo Mobile.

Raphael André Bauer

unread,
Jul 3, 2012, 11:00:39 AM7/3/12
to cha...@gmail.com, google-we...@googlegroups.com
Have a look at that the following demo:
http://code.google.com/p/play-gae-gwt-dreamteam-showcase/

Frontend and backend only talk via a restful Api. RestyGwt handles the
stuff on the client side of things. Note also that you can share Java
pojos easily between client and servers side...

Cheers,

Raphael

Nader

unread,
Jul 6, 2012, 2:03:45 PM7/6/12
to google-we...@googlegroups.com, cha...@gmail.com
For gwt side (client side) :
As mentioned by others restyGWT is a good choice though we customized it a bit to fit all our needs (especially around generic types). 
But take a look at Errai also :

For the server side :
For creating a rest API (or rest back end in your words!) consider using Spring Web MVC.

Кирилл Карпенко

unread,
Jul 6, 2012, 2:45:13 PM7/6/12
to google-we...@googlegroups.com

MIqp

03.07.2012 13:25 пользователь <cha...@gmail.com> написал:
Reply all
Reply to author
Forward
0 new messages