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

[jsr339-experts] Re: [jax-rs-spec users] Re: FWIW

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Fri, 26 Aug 2011 18:34:18 +0200

On 08/26/2011 06: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

Typically you would use command pattern whenever you need to execute something in batches. E.g. you are on a network
that experiences intermittent outages so in case of such outage you would queue the (failed) requests and then when the
network is up again, you would execute them using a generic invoke() API.

Another example would be if you decided to implement a client used by a SEDA[1] stage.

FWIW, it was originally Bill's requirement to support command pattern, so he may have a concrete real-life example.

Marek

[1] http://en.wikipedia.org/wiki/Staged_event-driven_architecture

>
> thanks, Sergey
>
>
>
>>
>> Marek
>
>