On Mar 26, 2009, at 2:47 PM, James Strachan wrote:
> 2009/3/26 Paul Sandoz <Paul.Sandoz_at_sun.com>:
>> 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.
>>
>>
>>> 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).
>
> DOH, of course :)
>
> Maybe we need an annotation like @Link or @Uri something which we can
> use on DTOs which avoids them being root resources but still allows
> them to be able to have their URI created.
Agreed.
>
>
>
>> 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.
>
> Agreed. Deeply nested resources could be troublesome too :). In lieu
> of figuring out a neat way to reuse the resource bean annotations for
> deeply nested resources with related DTOs; maybe we can just start
> with an annotation for DTOs?
Yes, i think so. Small steps first :-)
Paul.