Results 1 to 8 of 8

Thread: restlet vs. REST support in 3.0

  1. #1

    Question restlet vs. REST support in 3.0

    Hi,

    We are currently using RESTlet on a spring-based webapp. The integration was not so easy and we are basically evaluating the rest support in 3.0 to see if we can migrate from restlet to Spring MVC.

    Does anyone know the pros & cons of migrating from restlet to Spring MVC? Specifically, is there any big feature that only RESTlet provides?

    Thx,

    Stéphane

  2. #2
    Join Date
    Mar 2007
    Posts
    6

    Default

    Hi Stéphane,

    Could you explain the integration issues that you encountered between Restlet and Spring? Were you using Restlet 1.1?

    Best regards,
    Jerome

  3. #3

    Default

    Quote Originally Posted by jlouvel View Post
    Hi Stéphane,

    Could you explain the integration issues that you encountered between Restlet and Spring? Were you using Restlet 1.1?

    Best regards,
    Jerome
    Hi Jerome,

    No we are still using 1.0. I understand that 1.1 brings a tight integration with Spring. Since you're a core developer, I guess you'll be able to answer those questions

    This is what I need:

    * Ability to define an endpoint through configuration (something like a new bean where the name is the endpoint for instance. The ability to use annotations as an optional mechanism would be great too)
    * Ability to handle the cache easily through etags
    * Ability to define new output formats through configuration (same as 1)

    Our application has an open SDK and external developers may add new resources so endpoints, output formats and outputs need to be customized without touching the core configuration files of the server.

    I know that Spring will allow this since we're using those features for other stuff (e.g. hibernate entities deployment). If restlet can integrate, that would be awesome.

    Best,
    Stéphane

  4. #4
    Join Date
    Mar 2007
    Posts
    6

    Default

    Stéphane,

    We improved Spring support significantly in Restlet 1.1 so your experience would be very different if you could upgrade.

    We have also more documentation on this topic in our User Guide:
    http://wiki.restlet.org/docs_1.1/13-...0-restlet.html

    * It seems like you are looking for our SpringBeanRouter class

    * E-Tags can be easily managed via org.restlet.resource.Representation#getTag() and setTag(Tag) methods using the org.restlet.data.Tag class. This should be easy to set as a Spring bean properties. If you need a setTag(String) method to make it more convenient, let us know.

    * For dynamic Resource classes, you could set the "variants" property of your Restlet' Resource subclasses with a list of Spring-configured Representation beans. In this case there would be no need to implement the "represent(Variant)" method (or getRepresentation(Variant) in Restlet 1.0).

    This just requires you to pre-create a representation for each variant which shouldn't be too costly if you pay attention to lazy-load heavy stuff in your representations.

    Otherwise, we are ready to help you by making the necessary enhancements in the upcoming Restlet 1.2 version.

    Best regards,
    Jerome

  5. #5

    Default

    Nice! Well, the team here will take the time to analyze your suggestions. In the mean time, I just did my first rest endpoints with Spring 3.0. Not bad but definitely need more doc!

    I'll keep you posted.

    Thanks!

    S.

  6. #6

    Default Endpoints in Spring 3.0

    How were you resolving your views? The Spring 3.0 examples I have seen show examples like this:

    @RequestMapping(value="/owners/{ownerId}", method=RequestMethod.GET)
    public Owner ownerHandler(@PathVariable("ownerId") int ownerId) {

    Owner owner = new Owner();
    owner.setId(ownerId);

    return owner;

    }

    Where the page that would be displayed is a xml representation of the owner object. No step passing it back to a JSP page to convert it. As far as I can tell, this resolver hasn't been released yet. Did you do something different?

  7. #7

    Default

    Right. I have not done this indeed.

    I've done a standard return ModelAndView thingy.

  8. #8
    Join Date
    Jun 2010
    Posts
    1

    Default restlet vs native Spring support..

    Appreciate any comparison matrix between the latest versions of native Spring support and RESTlet library to implement RESTful web service.

    I am also curious on non-blocking IO support as well. I am aware of RESTlet roadmap on this but not Spring.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •