xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Hodges <harmo...@swbell.net>
Subject Re: versions of org.w3c.dom
Date Sat, 26 Aug 2000 01:41:57 GMT

----- Original Message -----
From: "Edwin Goei" <Edwin.Goei@eng.sun.com>
To: <general@xml.apache.org>
Sent: Friday, August 25, 2000 2:18 PM
Subject: Re: versions of org.w3c.dom


> Eric Hodges wrote:
> >
> > > -----Original Message-----
> > > From: Edwin Goei [mailto:Edwin.Goei@eng.sun.com]
> > > Sent: Thursday, August 24, 2000 2:39 PM
> > > To: general@xml.apache.org
> > > Subject: Re: versions of org.w3c.dom
> > >
> > > DOM is an evolving API that is backward compatible so you should be
able
> > > to use newer DOM interfaces with code that uses older ones.
> >
> > Only it isn't backwards compatible.  They added methods to interfaces
when
> > they did level 2, so code built using the old interfaces won't compile
> > anymore.
>
> How so?  If the (DOM1) app is already compiled, you don't need to
> recompile.  It should work with a DOM1 parser implementation or a DOM2
> parser implementation.  If you want to recompile then if the app is a
> DOM1 app, you should be able to use either a DOM1 or DOM2
> implementation.  However, if your app is a DOM2 app, you must use a DOM2
> impelmentation.
>
> What doesn't work for you?

I should have said code *implementing* the old interfaces won't compile
anymore.  If I have source that implements DOM level 1 interfaces it can't
be built if I have Xerces in the classpath.

Adding methods to a stable interface isn't backwards compatible.  One safe
and simple way to do it is:

interface Document2 extends Document {
    // new and modified methods go here
}

New implementations and clients deal with the new interfaces.  Old
implementations and clients deal with the old interfaces.



Mime
View raw message