Friday, July 25, 2008

RESTful Client-Side tools for GWT

I guess this is more of an announcement than a blog, but I just wanted to do a quick follow up to my last blog to mention some new developments pertaining to using a RESTful approach to GWT.

In my last blog, I spoke of RestLet, a server-side Java framework for REST. When I first learned of this technology, my cronies at Solertium Corporation and I fully embraced the concept, even doing some development on the open-source tool. Between then and now, I have been experimenting with client-side tools that provide reliable API through GWT to a RESTful server.

I first found GWT-REST, which if you saw my comments, I found to be pretty usable. Like the original developers of RestLet, though, I found it to have almost too much going on to make it work for me at the time. In addition, since, at the time, I have a strong code pattern that worked, it didn't make me want to go through the trouble of refactoring. After speaking with their development team, though, it looks to be strong in the future.
http://code.google.com/p/gwt-rest/

Since then, the RestLet guys have announced the release of a Restlet-GWT module, a port of RestLet to GWT, supported by the release of GWT 1.5. You can check out the official announcement here:
http://blog.noelios.com/2008/07/25/restlet-ported-to-gwt/

I am interested in seeing the differences between this and GWT-REST, but from my initial reading it seems that the RestLet version is an attempt at a direct port as opposed to something customized to have client-side conveniences implemented -- which I feel has strong and weak points, but the good should outweigh the bad here. I'm excited to see the implementation details, though! If you want a quick overview, the RestLet wiki provides pretty pictures and diagrams:
http://wiki.restlet.org/docs_1.1/g1/43-restlet/144-restlet.html

Again, I want to express that the RESTful method is more of an alternative to RPC than a replacement, both having benefits and drawbacks. The main drawback to RPC that has turned me to this approach is the tight client-server coupling issues and the limitations it enforces on your back-end server technologies.

My suggestion -- give Restlet's GWT module a shot. Like I said, it's an alternative, and it works right alongside RPC so it's not an either-or situation. We all have our own ways of getting the job done, but I'm always excited to hear of new developments and try them out, especially ones like these which make my job that much easier!

Thanks for your time in reading this. Feel free to comment with opinions for or against REST in GWT as I'd love to hear both sides. Also, if you'd recommend any technologies, again, feel free.

--
Carl Scott
Software Developer, Solertium Corporation
View Carl Scott's profile on LinkedIn View Carl Scott's ohloh profile


References:

6 comments:

  1. Hi Carl,

    I attempted Restlet's GWT API. It is working fine in the hosted mode, however when I compile my GWT app for the web mode, I am getting following errors. Have you experienced this or I am missing something? Error snippet is like:
    [ERROR] no source info: Class.createForEnum("org.restlet.gwt.data.","Dimension">

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi tin, I think you are the original poster of this bug, yes? If not, your issue might be a manifestation of the same issue -- you can post sample code if it's not already in the bug report. It is under investigation.

    ReplyDelete
  4. Hi Carl,

    You are right, I reported that bug.

    Regards,
    Nitin

    ReplyDelete
  5. Hi Carl,

    If you need to test, debug REST calls this tools is great. You can run make and replay REST calls directly from Eclipse:

    http://http4e.roussev.org/

    ReplyDelete
  6. I'm a cURL guy myself, but this definitely seems a bit more user-friendly! Will certainly check this out, thanks for the recommendation!

    ReplyDelete