users@jersey.java.net

Re: [Jersey] Hypermedia Support is useless

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 15 Feb 2010 13:16:23 +0100

On Feb 14, 2010, at 8:47 PM, Jan Algermissen wrote:

>
> On Feb 14, 2010, at 8:24 PM, Kevin Duffey wrote:
>
>> URIs to be called
>
> [Sorry to be sort of nitpicking here, but I think we should not
> confuse people with confusing use of terms (no insult intended)]
>
> URIs identify resources. You do not 'call' URIs. You invoke HTTP
> methods.
>
> The whole idea/notion of operations or actions is just misleading.
>
> HTTP is a protocol for transferring representations of resources
> through a uniform interface. Thinking in terms of order.review()
> does really not help others to grasp the concept. It just makes them
> think they do.
>

I think we may be getting caught up in the naming of things rather
than the particular pattern of hypermedia utilized by the prototype.

Consider the following renaming:

     @POST
     @TransitionTo("reviewed") @Path("reviewed")
     public void review(@FormParam("reviewer") String reviewer) {
         // Store the reviewer for auditing purposes
         order.setStatus(REVIEWED);
     }

And a client proxy:

     @TransitionTo("reviewed")
     public void transitionToReviewed(@Name("reviewer") String s);

The client proxy understands the link relation "reviewed" and thus
knows what HTTP method to use and what representation to send.

Paul.