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

[jsr339-experts] Re: [jax-rs-spec users] Re: Removing command pattern simplifies things

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Mon, 29 Aug 2011 18:14:56 +0200

On 08/29/2011 05:39 PM, Sergey Beryozkin wrote:
> Hi Marek
> On 29/08/11 16:35, Marek Potociar wrote:
>> Hi Sergey,
>>
>> On 08/29/2011 05:09 PM, Sergey Beryozkin wrote:
>>> Sure I understand that - my point is that we have request() in order to accommodate invoke() which is a corner case
>>> IMHO.
>>
>> The purpose of request() is not to facilitate invoke(). The purpose of request() is to make sure that Target does not
>> have to declare all the HTTP request header mutator methods, which would be against Separation of Concerns, Single
>> Responsibility and Interface Segregation OO design principles.
>>
> In your earlier revision, with prepare(), did you have all the above principles violated at the API level :-) ? The
> Basic example looked good even if was the case :-) and hence it's hard for me to 'swallow' request() but well...
>

I know, I know :) See my other reply for the explanation of my position in this particular case. I am very 50:50 on
this, with a slight tendency to lean towards the design principles.

FWIW, I initially had the request() there. I changed it only for a while based on an objection from Markus - that was
the time when I also introduced the extra Invocation.PreparedBuilder and the prepare() methods[*]. When Santiago and
Bill objected against removing the request(), I attempted for a compromise solution with request(acceptedMediaTypes).

Cheers,
Marek

[*] I would honestly love to see the PreparedBuilder and prepare() reintroduced because I hate build*() methods on
Invocation.Builder, but I am afraid I would be accused of running a pasta bistro once again... :)

> Cheers, Sergey
>
>> Marek
>