I've created the following JIRA:
http://java.net/jira/browse/JAX_RS_SPEC-117
as per Santiago's advice.
Here's a summary for the benefit of the list:
**********************************************
Currently Link class is an active entity which effectively acts as a client.
I'd like to propose splitting Link into two parts:
- base Link class which will only encapsulate the metadata and
properties about target URI
- ActiveLink extends Link and has setters as well as invocation factory
methods
Thus:
- Client.link factory methods would return ActiveLink
- Client.request(Link) would also be introduced
I've concerned about Link being overloaded with the client-like
capabilities.
Having original Client and multiple Links acting independently consuming
the same or different endpoints
is interesting. However,a number of considerations may need to be taken
into account:
- fluent style code involving Links may not be very robust - no Link may
even exist in the current payload and perhaps, more often than not some
analysis have to be done on a current Link before acting.
- I guess security considerations are also there
I think that Link->ActiveLink split will also work well in cases where
Link needs to be passed around without expecting intermediate handlers
to be involved.
*****************************************************
I won't be returning to this thread unless someone does comment.
I'd like to encourage experts to review this JIRA but I'm at the move-on
stage right now
Either way, Bill, Santiago - many thanks for helping me to appreciate
better how various Client API pieces are currently wired in together
Sergey
Thanks, Sergey