users@jersey.java.net

Re: [Jersey] JAX-RS == REST? Or not? (was Re: [Jersey] What HATEOAS actually means)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 18 Feb 2010 11:08:37 +0100

On Feb 17, 2010, at 6:04 PM, Markus Karg wrote:
>> An API cannot "do HATEOAS" anymore than it can "do REST". Only an
>> application can apply the REST constraints to its architecture to
>> induce the desirable properties.. An API can make it easier to apply
>> those constraints. We want to make it easier for developers to "do
>> HATEOAS" with their applications.
>
> No doubt about that, just had the impression that the API is likely
> to allow
> two things that would foil this idea: (a) Allowing the user to use
> any other
> header than "Link" (possibly proprietary "fancy" ones), (b) Allowing
> the
> user to defined links which will not transfer any state at all but
> just
> invoke any server sided method, which would result easily in RPC-style
> applications with the "JAX-RS" label on it, which we should prevent.
>

JAX-RS allows developers to implement GET with side-effects or support
cookies for session preservation. There is nothing we can do to
prevent developers from doing that if they want to. I think the same
thing applies with hypertext.

What we can do, and is what we have done, is discourage such
approaches and guide developers with presentations, examples and
documentation (see Goal 2 i previously mentioned, which i think is
especially important w.r.t. hypertext given the confusion it tends to
cause).

Paul.