users@jax-rs-spec.java.net

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

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 14 Dec 2011 10:04:03 +0000

On 13/12/11 18:15, Marek Potociar wrote:
>
>
> 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.

Sounds good for dropping them from builders themselves
Sergey

> 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
>>