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

[jsr339-experts] Re: alternative client api

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 23 May 2011 09:27:39 -0400

On 5/23/11 8:35 AM, Guilherme Silveira wrote:
> Hi guys,
>
> - You can finalize the DSL building on the post method, as Bill
> suggested,

BTW, my original proposal with execute() and resolve() also works well
with a command pattern. For example, you could have one piece of code
that queues up a bunch of different HTTP requests that needs to be
executed. The executor just calls execute() on each ClientRequest.


> which will create a long list of post/get/... variations,
> but it helps not to create an invalid invocation chain.
>

Its not like we're doing JPA-QL or something here. Its an HTTP request.
  I don't think I've ever built an invalid invocation with the style
I've suggested.

I think an important distiction needs to be made here from
implementation and users consuming an API. Abstraction is GREAT for
implementation, not so great for users consuming an API. A complex
interface and/or class hierarchy is not in the best interest for users.


>
> - If you dont want to force vendors to implement new methods, nowadays
> in interfaces you can add new methods and set up the default
> implementation.
>

In JAX-RS 1.x and JAX-RS 2.0 it seems any new methods that aren't simple
one liners are delegated to the vendor implementation anyways.


> Is it interesting to share the source code or try to apply any of
> those changes to your proposal?
>

Yes, I'm very interested in a clean DSL proposal. I want to see how
complex the interface/class hierarchy becomes in such a scenario.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com