users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Do we need getters on Request/Response + headers builders?

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 13 Dec 2011 19:15:13 +0100

On 12/13/2011 07:03 PM, Bill Burke wrote:
> Not sure what you mean. But, I think it would be awkward to go back and forth from a Request ref to a RequestBuilder
> ref if you're reading/writing from it in the same Filter.
>
> Other than I despise your builder hierarchy as its utterly confusing to users, what was wrong with RequestBuilder
> inheriting from Request?

If I look at JAX-RS 1.x, the response builder does not provide any getters and I don't see people would be missing it.
Which got me thinking, that even in the filter people may just use the request if they want to read something from it
and once they start updating it, they seldom need to interrupt that code flow to read more data from the request.

IOW, seems to me that the following pattern is not very likely:

RequestBuilder rb = ...;
rb.header(rb.getHeader("name"), "newValue")...;

So it would make sense to keep the two interfaces completely decoupled.

Marek

>
> On 12/13/11 12:46 PM, Marek Potociar wrote:
>> ..unless I hear any objections, I would like to remove all the getter methods from these builders.
>>
>> Marek
>