users@jersey.java.net

Re: [Jersey] Interlinking resources

From: Imran M Yousuf <imran_at_smartitengineering.com>
Date: Thu, 26 Mar 2009 19:46:14 +0600

On Thu, Mar 26, 2009 at 2:44 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
> On Mar 25, 2009, at 7:00 PM, James Strachan wrote:
>>>
>>> You can do this:
>>>
>>>  UriBuilder.fromResource(B.class).build(idForB);
>>
>> Awesome! :) I'd not spotted that!
>>
>> That only works with resource beans right?
>
> It works for any class annotated with @Path.
>

This is actually cool! But as I replied to Marc's email I actually
wanted to avoid the converting an DTO to a RESTful Model before
exporting, that is just adding more code, I was wondering whether
there is some way to get it done automatically or not.

>
>> I wonder if it'd work if we
>> used @Path on a DTO rather than a Resource?
>>
>
> It should but then @Path also signifies that the annotated DTO would be a
> root resource class (if registered).
>

Hmm, I feel the "if registered" part is important for me :).

> I am wondering if in general we need a "link model" that can be obtained for
> a resource that describes the root link and sub-resource links, and from
> which URIs can be instantiated. The JAXB WADL beans provides that, but i
> think something more focused might be easier to use.
>
> In general this area needs a lot more investigation and experimentation. Two
> experiments which seem to go rather well were using AOP to fill in the links
> of JAXB beans, and the integration with Sommer (RDF framework) using a
> JavaBean property model where properties correspond to templates.
>

Very interesting indeed, to be honest I asked the question just to
confirm that I am not working on something that already exists :). I
have started work on something just like this. Once I have a
meaningful code and a prototype I will RFC from all of you :),
hopefully I will have something more on it by next Monday.

Thanks a lot for all views and comments.

Best regards,

Imran

> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>



-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran_at_smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557