InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

How RESTful Are Web Frameworks That Claim REST Support?

Posted by Dilip Krishnan on Jul 13, 2010

Sections
Enterprise Architecture,
Architecture & Design,
Development
Topics
Ruby ,
Java ,
Dynamic Languages ,
REST ,
SOA ,
.NET ,
Languages ,
Architecture ,
Enterprise Architecture ,
Programming ,
Frameworks

There are plenty of web services platforms/application frameworks available today that support RESTful services to varying degrees. In a recent post Stefan Tilkov puts out a list of criteria that serves as a starting point in evaluating these frameworks and platforms.

He Proposes that, at a high level, the questions one must ask are are (the more “yes”s for the answers the closer a framework is to an ideal REST web application framework).

    • Does the framework respect that an HTTP message does not only consist of a URI? I.e., is dispatch done at least based on the HTTP verb, the URI, the Content-type and Accept headers?
    • Can I easily use the same business logic while returning different content types in the response?
    • Is there support for checking for conditional requests?
    • Are ETags calculated automatically if none are set by the backend logic?
    • Can I (as a framework user) easily read all HTTP request headers?
    • Can I easily set all HTTP response headers?
    • Can I use custom HTTP verbs?
    • Is it obvious and easy how to return correct status codes with responses, and does the framework use them correctly (if it does so at all)?

Mike Amundsen suggests additions to the REST Litmus Test for Web Frameworks list, He suggests that the various components of a URI the path and the query string, carry the same weight to distinguish a resource from another. He quotes Roy T. Fielding on REST-Discuss, 2002,

[F]or server-constructed URI, there is no effective difference between query and path info -- both distinguish a resource.

A few prominent web frameworks that support developing RESTful services are:

Java

.net

Ruby

Python

Do add your comments so we can maintain an updated list of frameworks and platforms for building RESTful services. Be sure to visit  the original post for details.

  • This article is part of a featured topic series on SOA and also Java

16 comments

Watch Thread Reply

Same initiative by Alex Popescu Posted
another one by lo vuikeng Posted
Re: another one by Dilip Krishnan Posted
Re: Spring MVC's REST Capabilities by Keith Donald Posted
Re: Same initiative by James Watson Posted
Apache CXF by David Karr Posted
What about HATEOS? by Michael Pilone Posted
Re: What about HATEOS? by Shimon Amit Posted
Re: What about HATEOS? by Tero Vaananen Posted
Re: What about HATEOS? by James Watson Posted
Re: What about HATEOS? by Julian Browne Posted
Re: What about HATEOS? by Rafael de F. Ferreira Posted
Re: What about HATEOS? by Guilherme Silveira Posted
Re: What about HATEOS? by Juergen Brendel Posted
Lift Framework? by Jim K Posted
RESTx by Ross Mason Posted
  1. Back to top

    Same initiative

    by Alex Popescu

    After reading Stefan's post I've had the same initiative asking around what web frameworks are really passing this test. So, far the answers I've got are:

    - JAX-RS implementations
    - webmachine (Erlang/Basho)

    While I'm not very familiar with either Django and Ruby on Rails, as far as I know both of them will have problems with at least the 1st test (and I think Django is not passing the 2nd test either, as it is more of an action based framework).

    :- alex

  2. Back to top

    another one

    by lo vuikeng

    Don't forget SpringMVC 3.0

  3. Back to top

    Re: Same initiative

    by James Watson

    I'm a big fan of JAX-RS (Jersey). I'd even want to use it to implement non-restful services. It's really quite nice.

  4. Back to top

    Apache CXF

    by David Karr

    I find Apache CXF to be a very good JAX-RS implementation (it also provides a JAX-WS implementation).

  5. Back to top

    Re: another one

    by Dilip Krishnan

    Thanks! updated the post.

  6. Back to top

    What about HATEOS?

    by Michael Pilone

    I would suggest adding HATEOS support to the list of REST framework criteria. I haven't seen a good framework yet that easily supports the idea of returning URIs to other resources without requiring you to write custom views that render your internal domain objects to "restful" responses. The Restfulie GEM in RoR is at least trying to provide an implementation but it isn't there yet.

    For example, look at something like the Netflix API which appears to support HATEOS very well. I'm assuming they implemented a lot of custom code internally to get that behavior.

    -mike

  7. Back to top

    Re: What about HATEOS?

    by Shimon Amit

    Excellent point.

  8. Back to top

    Re: What about HATEOS?

    by Tero Vaananen

    Resfulie supports HATEOAS.

  9. Back to top

    Lift Framework?

    by Jim K

    I'm surprised no one has mentioned Lift yet.

  10. Back to top

    Re: What about HATEOS?

    by James Watson

    I'm interested in seeing how they approach this but something went wrong. They are sorry.

    restfulie.caelum.com.br/restful_java

  11. Back to top

    RESTx

    by Ross Mason

    I just wanted to point out that RESTx is both Java and Python. Developers can write components (that can be used to create resources) in both languages and we're looking to add support for Groovy and Ruby, plus a JavaScript client.

    It is still early days for the project but would love to get your feedback on it.

    Ross (at mulesoft dot com)

  12. Back to top

    Re: What about HATEOS?

    by Juergen Brendel

    RESTx does support HATEAOS. It does so in two ways: First, all the components and resources on a server can be discovered just by following links. Secondly, component authors may use a built-in facility to store items, which can be viewed as a collection. If so desired, a request to this collection returns a list of all resources. When a new resource is created, the "202 Created" response is returned with a link to the new resource.

  13. Back to top

    Re: What about HATEOS?

    by Julian Browne

    I'm interested in seeing how they approach this but something went wrong. They are sorry.

    restfulie.caelum.com.br/restful_java


    Though, to be fair, they will take a look at it shortly.

  14. Back to top

    Re: What about HATEOS?

    by Rafael de F. Ferreira

    RESTfulie java can be found at:

    github.com/caelum/restfulie-java#readme

  15. Back to top

    Re: Spring MVC's REST Capabilities

    by Keith Donald

    If you'd like to see how Spring MVC stacks up, checkout the following showcase:

    blog.springsource.com/2010/07/22/spring-mvc-3-s...

    Keith

  16. Back to top

    Re: What about HATEOS?

    by Guilherme Silveira

    The link is an old one, where did you find it so we can update it?

    Regards