Restlets, the next thing after servlets?

I have been looking for a client side API for implementing the Atom Publication Protocol (APP). Since APP is based on REST principles it would be nice for there to be a good Java library that worked at the right level of abstraction.

Dave Johnson has recently written a book where he uses the apache commons httpclient library to implement APP. The code is available on blogapps.dev.java.net, in the chapter10/atomclient directory.

Last week I came across the Restlet library that is designed to work both for client tools as well as for servers, and is designed to replace the Servlet interface. Could this be even better? It is certainly taking the paradigm seriously and so does warrant a close look.

Feedback welcome, and I'll post my experiences.

Comments:

I spent a couple of hours trying to figure out the Restlet API and could not figure out what it is supposed to do and why I would want to use it. My first impressions were that it is overly complex and the developer's decision to completely bypass the Servlet API was based on faulty assumptions (e.g. the NIO complaint). I've got to REST-enable a Servlet app and explain REST in simple terms, so I gave up on Restlets pretty quickly. I'd be very interested in hearing your thoughts on the topic.

Posted by Dave Johnson on March 21, 2006 at 06:34 AM CET #

Hi Dave,

In order to understand Restlets, you have first to be familiar with the concepts of REST. Have you read the chapter defining REST?

The Restlet API is mapping one-to-one each concept of REST into a Java interface. So in term on complexity it shouldn't be much more than the complexity of REST. And we are still in the beta phase, so please help us simplify the API even more. BTW, the Restlet API JAR itself is very light, about 65kb with no external dependency.

Concerning the Servlet API, you probably missed the fact that there is a connector allowing you to run your Restlets within a Servlet container. But if you don't need a Servlet container, I suggest to use the standalone HTTP connector powered by Jetty.

The NIO assumptions are based the analysis of an expert participating to the Servlet API specification process, Greg Wilkins, who is BTW the main developer of Jetty! Please read the Restlet introduction paper for further references.

Finally, did you run the tutorial examples? Didn't they make sense to you at all? If not, please feel free to seek support in our mailing list, we'll be glad to help you.

Best regards,
Jerome Louvel

Posted by Jerome Louvel on March 23, 2006 at 06:33 AM CET #

Yes, Jerome, I've read Fielding's paper on REST and implemented both an Atom protocol client and server so I know a little bit about REST in practice. I also read your introductory paper and looked at (but did not run the tutorial). From my point-of-view, the beautiful thing about REST is simplicity (even a dumb guy like me can implement it) and I did't see that simplicity in your framework.

Posted by Dave Johnson on March 23, 2006 at 07:08 AM CET #

Hi, Well beauty is in the eye of the beholder. It seemed relatively easy to understand RESTlets, but I'll really know better if I try rewriting Dave Johnson's book examples using them. Then we'll have something to compare. :-)

Posted by Henry Story on March 23, 2006 at 07:14 AM CET #

That's a good idea for Jerome. Since Atom protocol is one of a few hi-REST based standards, implementing it using RESTlets would be a great example.

Posted by Dave Johnson on March 23, 2006 at 07:32 AM CET #

Sounds good to me too! I'm looking forward to help Henry implementing the Atom protocol with Restlets. That will certainly be a good opportunity to improve the API.

Posted by Jerome Louvel on March 23, 2006 at 07:42 AM CET #

I should be able to get to it the week after next. Next week I need to write a new version of the rdfhibernate library. Right now I am working on some wizards for Sun.

If someone in the meantime rewrote Dave Johnson's example atom client using restlets, that would probably help me along very much. It would also probably end up being very helpful to the atom protocol working group as that is sure to reveal some interesting problems.

Otherwise I'll have some good experience in a couple of weeks...

Posted by Henry Story on March 23, 2006 at 11:14 AM CET #

I will have a closer look at it tomorrow and next Monday. I'll try to get the main pieces together to get you started. Is there an easy way to test this proctocol? Do you know if Wordpress (my blog's server) supports Atom? Jerome

Posted by Jerome Louvel on March 23, 2006 at 12:44 PM CET #

There is an APP test Suite available, and a number of servers pop up from time to time. The best thing would be to ask on the list if you get to that point. (It would be helpful to have a wiki page with a list of servers and clients for people to play with)

Posted by Henry Story on March 23, 2006 at 02:02 PM CET #

Post a Comment:
Comments are closed for this entry.
About

bblfish

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today