jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Some feedback on the declarative hyperlinking proposal

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 20 Jul 2011 13:55:42 +0100

Hi,

I've tried to catch up with the declarative hyperlinking proposal.
Apologies for not continuing in the original thread, I feel it's be
easier to follow multiple feedbacks if I start a new thread.

Basically, I think the proposal looks interesting. IMHO the header-based
  linking is more practically sound. Some simplification is warranted
IMHO too. Overall it's a good effort from RI/Resteasy.

More specific comments:

1. As far as the practicality is concerned, I believe that most
'conservative' consumers (server/client side) doing the schema
validation will fail the links embedded inside a given representation.
It simply won't work - it does not matter if the schema validation is
deemed as not so best practice to follow or not.

2. @Ref/_at_Style should be ABSOLUTE by default, which I believe is being
currently discussed in the other email

3. I honestly do not see the point of supporting anything other than
'resource' source as it the only approach which 'justifies' the whole
added complexity of adding these annotations but with the benefit of
having a clean separation between the model entity, resource managing
the representation of it and the representation itself.

What are the use cases for "instance" and "entity" ? Can the wiki be
updated to demo these cases too please ? I'd like to understand why I'd
ever want to use @Ref with "instance"/"entity" instead of manually
building the links

4. I think we should introduce Linkable<T> class or similar and
ItemRepresentation would implement Linkabale

thus we'd always have only

@Ref(resource=ItemResource.class, type=NEXT)

I think having EL expressions in this case are redundant and complicate
things. Any particular Linkable<T> impl will know what to return in its
  isNext() or isPrev depending on a particular context.

Thoughts ?

Sergey


-- 
Sergey Beryozkin
http://sberyozkin.blogspot.com
Talend - http://www.talend.com