users@jax-rs-spec.java.net

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

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Mon, 5 Nov 2012 16:49:11 +0100

On Nov 5, 2012, at 4:20 PM, Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com> wrote:

>
> 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.

Ah - sorry, I missed that UriBuilder supports building from class, too now.

In general, I find it kind of hard to find out what has been added to the API in 2.0. Hence excuse the occasional confusion.

Jan


>
> -- Santiago
>
>