db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Korneliussen <Andreas.Kornelius...@Sun.COM>
Subject Re: [jira] Updated: (DERBY-1146) Verify that JDBC4 signatures satisfied
Date Tue, 28 Mar 2006 12:24:49 GMT
Anurag Shekhar wrote:
> 
> 
>> Also, I think this also indicates that we should consider using 
>> delegation instead of inheritance for code reuse.
>>
>> Andreas
>>
> I didn't get it, how does it indicates that ?
> anurag

Because now we are fooling the compiler to think that EmbedXXX40 classes 
implement java.sql.XXX interface since it inherits from a class which 
has declared that it implements it. The problem is that the base class 
is compiled against an old runtime library, and we lose the compile time 
checks for the new methods.

This way of doing things was not introduced as part of JDBC4, it also 
applies to JDBC3 vs JDBC2.  So basically a developer may accidentally 
change the signature of a JDBC3 method, and the compiler will not 
complain. You will only detect the error in runtime, i.e through tests.

Andreas

Mime
View raw message