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

[jsr339-experts] Re: [jax-rs-spec users] Re: alternative client api

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Mon, 23 May 2011 11:01:10 -0400

On May 23, 2011, at 10:31 AM, Bill Burke wrote:

> On 5/23/11 10:05 AM, Marek Potociar wrote:
>> On 05/23/2011 03:49 PM, Bill Burke wrote:
>>> Adding methods to an interface does not break backward compatibility. Removing and changing method signatures does. The
>>> Servlet API, for example, has added numerous new methods over the years.
>>
>> The statement above is true only if it is 100% clear that users MUST NOT implement the interface. Otherwise the user
>> code fails to compile against the new version with new methods added to the interface.
>>
>> I am not sure if such constraint holds true also for our case, esp with interceptors/filters in play.
>>
>
> I'm not convinced that this constraint you talk about is observed in the Java EE specification process.
>
> As a framework developer and servlet Filter developer I've been forced many times to implement the ServletRequest and HttpServletRequest interface. This is just one example I can think of off the top of my head.

 Strictly speaking, adding methods to an interface may indeed break backward compatibility. However, if there is precedence in EE, we should get more info as to how they managed to do it. I'll check with the Servlet spec leads and report back.

-- Santiago