[jdom-interest] Java 1.5 language features.
mj-lists at expertsystems.se
Tue Feb 27 02:16:30 PST 2007
>>> What happens when Software A uses JDOM 2.0 while Software B uses JDOM 1.0, and you want to write Software C that uses both Software A and Software B? Can you just drop in JDOM 2.0, ignore JDOM 1.0, and have Software B (built maybe against an old version of Java) satisfied? Anyone have experience with this?
>> As discussed previously on this list, adding generics but no other new
>> features should be backwards compatible with APIs requiring JDOM 1.0,
>> just like the generified java.util.* collections in JDK 1.5 are
>> backwards compatible with older APIs.
> You need to be very careful what you mean by "backwards compatible".
> I think the following statements are true:
> (a) if the JDOM interfaces are changed to use generics, then the JDOM code
> must be compiled under JDK 1.5, in which case it will only run under JDK 1.5
> or later, and any client applications must therefore be run under JDK 1.5,
> though they do not need to be recompiled.
> (b) if you compile JDOM under 1.5, even without any source code changes, and
> users drop it in as a replacement for the existing JAR file, then if they
> are running 1.4 their applications will stop working.
Yes, of course.
"Backwards compatible" was with regards to the quote which you removed
If API A is compiled under JDK 1.4 against JDOM 1.0 and API B is
compiled under JDK 1.5 against generified JDOM 1.5, both APIs can be
used in software C - assuming JDK 1.5 of course.
As I said, just compare to the standard JDK runtime classes. In our JDK
1.5 environment, we use lots of APIs compiled against JDK 1.4 (or older)
runtime classes. One example is JDOM...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdom-interest