users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Link default behavior doing 'too much'

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Mon, 5 Nov 2012 10:20:30 -0500

On Nov 5, 2012, at 10:09 AM, Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com> wrote:

>
> On Nov 3, 2012, at 6:56 PM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:
>
>>
>> On Nov 3, 2012, at 11:29 PM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:
>>
>>> Hi,
>>>
>>> playing around with Link I realize that it makes me 'work around' to achieve most basic use cases:
>>>
>>> - I often only want the URI of a given resource class or sub
>>> resource; since Link building requires me to pass a rel value
>>
>> Have to correct myself here, because fromResourceMethod() provides a version without required rel value.
>>
>> What is missing for me is
>>
>> fromResource(Class<?> resource)
>>
>> in addition to
>>
>> fromResource(Class<?> resource,String rel)
>
> Well, yes, for symmetry with the other two methods we should add this one as well.

 Actually, I responded too soon to this one. Method

 Link.fromResourceMethod(Class<?> resource, String method)

 is there for CoC given that it is not uncommon to use method names as rel values. Check out the cluster service in our examples. Again, there's always a way of building a Link from a URI.

-- Santiago