Leveraging Lambda for JDBC 4.2

Lance Andersen - Oracle Lance.Andersen at oracle.com
Thu Dec 6 13:16:05 PST 2012


On Dec 6, 2012, at 3:47 PM, Ulf Zibis wrote:

> Am 06.12.2012 19:50, schrieb Lance Andersen - Oracle:
>> On Dec 6, 2012, at 1:37 PM, Mark Rotteveel wrote:
>> 
>>> However for required methods I think it is a really bad idea. One of the nice things about interfaces is that having a required method not implemented will be immediately and forcefully signaled to the driver developer by a compile time error (both in the IDE and at building the driver). Introducing a default method that throws UnsupportedOperationException will remove those handy signals.
>> The problem that  you have is for APIs such as JDBC to improve the API, you need to add methods where they naturally reside.  This causes problems for people that their code will no longer compile on the new version of Java
> 
> 1. Is it really necessary, that people compile there code against a new version, shouldn't it suffice to compile against the older appropriate version?

For some yes, for many others it is not that easy.  Appserver vendors,  Web containers and other products have their own JDBC wrappers and this has been a constant irritation.   For a variety of reasons they want to be able to compile
against multiple code bases.

There is no magic solution that works for everyone this at least reduces the pain for some (outside of a completely new API which is not going to happen any time soon)
> (When new gasoline is invented, one can't expect old machines to accept that.)
> 2. Doesn't -target 1.7 help?
Not for all
> 3. They could preload the old version of the interface via -bootclasspath.

That does not really work either and in some cases you need to support a mix of Java SE environments
> 
> So I really tend to agree with Mark.

I appreciate the input from both of you.

Best
Lance

> 
> And last, I still have doubts to welcome that new "default concept" at all, see:
> http://mail.openjdk.java.net/pipermail/lambda-spec-observers/2012-October/000123.html
> http://mail.openjdk.java.net/pipermail/lambda-spec-observers/2012-October/000119.html
> 
> -Ulf
> 

-------------- next part --------------

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com



More information about the jdbc-spec-discuss mailing list