[jdom-interest] XPath class

Hallvard Tratteberg hal at idi.ntnu.no
Thu Mar 14 01:39:20 PST 2002


Jason,

> I've been wondering about this.  It would be also possible (if we care
> to provide different XPath impls) to follow the JAXP model where the
> XPath class delegates construction to an implementation specified by a
> system property.  The JAXP way is nice since it lets you change impls
> without recompiling.

If the abstract XPath class has a public static makeXPath method, like the
one I sent, it may easily be changed to support this. If we instead rely on
using a constructor (new) we cannot do this.

BTW, this is one of the most elegant things in Dylan. Instead of using a
special operator and constructors, each class has a make method, which may
be overridden, that may create an instance of a sub-class depending on the
arguments, and possible an existing instance.

Hallvard




More information about the jdom-interest mailing list