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

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

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Fri, 26 Aug 2011 20:48:14 +0200

On 08/26/2011 08:03 PM, Bill Burke wrote:
>
>
> On 8/26/11 12:22 PM, Sergey Beryozkin wrote:
>> On 26/08/11 17:19, Marek Potociar wrote:
>>>
>>>
>>> On 08/26/2011 06:03 PM, Sergey Beryozkin wrote:
>>>> In the previous revision Invocation was a 'dead' redundant entity
>>>> only waiting to be dropped. It's back...
>>>
>>> As author, I disagree. Invocation is the encapsulation of command
>>> pattern concept. It would not be dropped.
>>
>> As I said in the other email, I'm fine with it staying, as long as we
>> can come up with a more or less realistic example showing that command
>> pattern in action, can you please think of one ? I'll +1 if yes
>>
>
> Sergey has a huge point which I alluded to in a previous email. Wasn't the command pattern something somebody suggested
> (me I think), rather than based on user input? Taking it out simplifies things a lot.
>
>

Yes, it was you who requested to add invocation:

On 05/23/2011 03:27 PM, Bill Burke wrote:
>
> 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.

Are you now suggesting we take the generic invocation out?? Apart from losing a lot of potential flexibility I don't see
how that's going to improve things. The fluent client API is now pretty much clean, easy to use and understand, fluently
consistent and still pretty concise. At the same time, it is possible to flexibly tweak any aspect of a request even
outside of the filter, if the app desing requires it. I'm afraid that, at this point, removing the invocation would put
us several steps back in discussion about what would we need to remove from the request API to keep the fluent flow
consistent while still being able to make invocation extend the http request and not sacrifice any major functionality
of filters... I am not sure we want to go back there. At least certainly not me.

Marek