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 14:53:38 +0100

Hi,

On 29/08/11 13:24, Bill Burke wrote:
>
>
> On 8/29/11 5:37 AM, Sergey Beryozkin wrote:
>> Invocation.prepare(t).get() is a flow on its own and its initialized
>> when it's really needed to be able to do invoke() or submit() in a
>> generic fashion...In all other cases - just target.get()/post()/etc;
>>
>
> It seems like it could be strapped on quite easily later on. Maybe wait
> for user feedback and add it to a 2.1 release of the spec?
>

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:

client.target("http://examples.jaxrs.com/").request().buildPut(text("Hi")).invoke();

ouch...

In both cases we can't break from this Target-to-Invocation link.
I propose to break it right now without dropping completely a support
for creating Invocations.

I did like what the previous revision from Marek was offering at the
user level. Just moving prepare() from Target to Invocation would be
just it, the perfection nearly...

What do you propose when you say that Removing a command pattern
simplifies things ? Do you like to keep Target & Invocation explicitly
linked but without support for invoke()/submit() ?How will the code look
like ?

Thanks, Sergey


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