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

[jsr339-experts] Re: Removing command pattern simplifies things

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Mon, 29 Aug 2011 16:04:15 +0100

On 29/08/11 15:50, Santiago Pericas-Geertsen wrote:
>
> On Aug 29, 2011, at 10:35 AM, Bill Burke wrote:
>
>>>
>>> It's my turn to ask for some code examples.
>>> To me, the reason Invocation exists in the 1st place is to provide an
>>> option for invoke() and submit() at the end of the chain, and thus let
>>> generic handlers deal with it.
>>>
>>> The earlier revision from Marek allowed for an explicit transition from
>>> Target to Invocation via Target.prepare(). The current revision provides
>>> nearly the same link, via Target.request(). It just looks worse but
>>> essentially the same:
>>>
>>
>> I personally don't like Target being an "uber" interface. In previous versions when you looked at Target you didn't know what it was. Is it a resource? does it represent a URL? A Request? Headers? What?
>>
>> A request() method separates concerns. Target is a resource, Invocation is a request.
>
> +1
>
> The Target interface looks weird without this explicit transition.
>
>>

Just few days ago you were all explaining to Bill how important it was
to keep users happy, not worry too much about the way interfaces were
wired in and now having request() leaking into every user's invocation
does not really a bell at all - how come ?



>>> client.target("http://examples.jaxrs.com/").request().buildPut(text("Hi")).invoke();
>>>
>>>
>>> ouch...
>>>
>>
>> Yeah, but, generic invocations are a corner case. This looks fine:
>>
>> client.target("http://").request().put(text("Hi"));
>>
>> I personally don't care much if there is extra steps to support the corner case of generic invocations. For corner cases in general, I think its ok to add extra steps.
>
> Exactly.

Yea - I'd agree with that of course - the situation here is that in
order to address those corner cases all the API has to pay request().
That works, just disappointed the group seems it's not a big deal

Sergey

>
> -- Santiago
>


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