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

[jsr339-experts] Re: Some comments about Target and Invocation

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 1 Sep 2011 10:09:25 +0100

Hi Marek

On 31/08/11 18:46, Marek Potociar wrote:
> As I said, you can iterate over path hierarchies using BFS ( http://en.wikipedia.org/wiki/Breadth-first_search )
> algorithm. If that's not practical, you can use DFS + stack (
> http://en.wikipedia.org/wiki/Depth-first_search#Algorithm_using_a_stack ). The stack can be explicit or you can leverage
> the implicit call stack by implementing recursive iteration.
>
> Btw. I would like to see the real life use case.

I hope the following won't appear to be too hypothetic:

1. We have a base URI. We have a collection of Book IDs. We know the
service allocates a unique URI to each Book using a baseURI + "/" +
BookID, example, http://books/1, etc. I'd like to use the client API to
do repetitive invocations to retrieve all or some of the Books

2. Similarly to one, but using a query param.

I think the fluent API should be flexible enough to accommodate for
repetitive invocations against the same targetURI without forcing a user
to retype things which are shared across requests, ex, an accept type,
base URI, Content-type.

Can you give me a favor and actually type some code showing how say 1
can be done, please don't hesitate to use BFS or DFS techniques

Thanks, Sergey


>
> Marek
>