users@jersey.java.net

Re: [Jersey] State Client / HATEOAS proposal

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 13 Oct 2009 14:36:32 +0200

On Oct 12, 2009, at 12:27 PM, gerard davison wrote:

>
>
> On 19:59, Paul Sandoz wrote:
>>
>>> Although this is a bit wordy it would allow a generation tool to
>>> grab and generate an interface for this WADL, and if it contains
>>> suitable grammar links it should be able to give you the correct
>>> types also. I would be happy if someone has a better suggestion
>>> though....
>>>
>>
>> Just a general point it would be good if JAXB related model classes
>> could be used on the client or server. Thus when the server
>> serializes links are embedded. When used on the client it helps
>> create typed artifacts to aid clients traversing state.
>
>
> Yeah, I am pretty sure this will work with the same classes/
> interfaces, you can hide a lot of finangling behind the proxies.
> Currently you can use the "Resource" proxies as both parameters and
> return values in the proxy so it shouldn't take long. I just haven't
> had the time to write the final bits of glue code in the server side
> as I currently need to work out the following:
>
> 1. A instance of the "Client" in order to be able to create these
> links for example the one you might use to inject WebResource
> instances. (Obviously I would need to do something clever for links
> in the same server as as not to require a network access)
> 2. The current base URL for the current request.
> 3. A helper code that can be used to extract parameters from a URI,
> code that does the opposite of URIBuilder.build(...) I guess
>

For the latter see:

   https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey/com/sun/jersey/api/uri/UriTemplate.html


> If you have any thoughts on any short cuts on any of these I would
> be interested to hear them.
>

No immediate things pop out for the first two. Currently i classify
myself as time bankrupt. I need some solid think time around all the
hypermedia stuff and that is not realistically going to happen until
EE 6 is out of the way. Sorry i cannot be of much help at the moment :-(

Paul.