users@jersey.java.net

Re: [rest-discuss] hateoas - draft #1

From: Jan Algermissen <algermissen1971_at_mac.com>
Date: Thu, 15 Oct 2009 16:10:05 +0200

On Oct 15, 2009, at 3:51 PM, Felipe Gaścho wrote:

> I started to redesign my service towards HATEOAS. The goal is to allow
> a robot to navigate through the application without previous knowledge
> of the mapping between the URIs and the states of the application. Not
> easy, but I will try...
>
> So, please check these links and tell me if I am going in the right
> direction:
>
> ------- Loads all institutions:
> http://fgaucho.dyndns.org:8080/arena-http/institution
>
> * notice the "next" link inside the response

The semantic of 'next' is 'subsequent page' not 'drill down' which you
seem to use it for.

> * ok, perhaps here I need to inform the supported types of
> institutions (sponsors, owners, schools, etc.) in the OPTIONS method..

No, not necessarily. But a hint is allways good.

>
> ------- Loads only the competition of type "competition owner":
> http://fgaucho.dyndns.org:8080/arena-http/institution?role=PUJ_OWNER
>

This is a problem (see 'next' above) since the specific intention of
'Loads only the competition of type "competition owner"' is not
communicated ny the link rel.

> * it is an example, this link is embedded in the previous link...
>
> ------- Loads the competitions by "institution owner":
> http://fgaucho.dyndns.org:8080/arena-http/competition?
> institution=CEJUG
>
> * it is an example, this link is embedded in the previous link...
>
>
> --------
>
> I am also including only a relative path, instead of a complete URI..
> perhaps it is enough for an alpha release..

Depends on the media type that defines the link element. Usually it is
ok.
>
> * of course there are much more coming up, but if you can bring me
> some thoughts about the above sample URI, I can avoid to spread
> mistakes all over the new coming code :)

Instead of application/xml you need to use a media type that allows
the client to understand what is really meant by the message. If you
use application/xml then all the client can assume is 'process this as
xml' and that does not get you very far :-)


HTH,

Jan


> * the goal is to makes it the most HATEOAS compatible as possible :)
>
>
> it remains in the proof of concept phase ... and now using EclipseLink
> and Java EE 6 on Glassfish V3 :)
>
> thanks for your contribution,
>
> Felipe Gaścho
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
> <*> To visit your group on the web, go to:
> http://groups.yahoo.com/group/rest-discuss/
>
> <*> Your email settings:
> Individual Email | Traditional
>
> <*> To change settings online go to:
> http://groups.yahoo.com/group/rest-discuss/join
> (Yahoo! ID required)
>
> <*> To change settings via email:
> mailto:rest-discuss-digest_at_yahoogroups.com
> mailto:rest-discuss-fullfeatured_at_yahoogroups.com
>
> <*> To unsubscribe from this group, send an email to:
> rest-discuss-unsubscribe_at_yahoogroups.com
>
> <*> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>

--------------------------------------
Jan Algermissen

Mail: algermissen_at_acm.org
Blog: http://algermissen.blogspot.com/
Home: http://www.jalgermissen.com
--------------------------------------