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

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

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Mon, 29 Aug 2011 11:41:52 -0400

On Aug 29, 2011, at 11:21 AM, Sergey Beryozkin wrote:

> On 29/08/11 16:12, Bill Burke wrote:
>>
>>
>> On 8/29/11 11:04 AM, Sergey Beryozkin wrote:
>>> Just few days ago you were all explaining to Bill how important it was
>>> to keep users happy
>>
>> Its funny because I've been trying to do the exact same thing: explain
>> how important it is to keep users happy. A API design that makes sense
>> and is self-documenting creates a lot of user happiness.
>>
> LOL :-)...
> I'd say as a user I want to see
>
> target.path(...).header(blah).get();
>
> get() *is* a request. Thus request().get() is a duplication. The transition may look better at the interface level - but no so at the user level (at least to me). The problem is request() is only there to address the case which most of users like me won't deal with.

 A target and a request are clearly separate concepts. I can create a target and then submit multiple requests from it. IMO, the transition looks good even at the user level. Consider,

 Target target = …
 target.header(…)

 What does it mean to add a header to target? Headers really belong to requests, not targets. To semantically explain the statement above, you need to think about the transition between a target and a request, and I in general like things to be explicit.

-- Santiago