[jdom-interest] Comments on XPath API

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon Apr 29 06:42:50 PDT 2002


Hi,

Elliotte Rusty Harold wrote:
> 2. Why bother with factory method? Because it's an abstract class. OK, why
> is the XPath class abstractThe original post was not abstract and was tied to Jaxen. One of the (few) 
feedbacks we got was that it would be nice to be able to plug other 
implementations in. As no one objected at that time, XPath went abstract.

Additionnaly, Jason stripped the actual factory code from the XPath code 
currenly in CVS so it kinda looks dumb and the abstract thing artificial. But 
this code exists and works.

> This design pattern is a significant factor in DOM's complexity and 
> confusion.
This is different here as there is no one object made factory. The user just 
sees the XPath object itself.

> As demonstrated by SAXBuilder and my recently submitted XSLTransform class,
> it is possible to support multiple implementations and still keep the 
> JDOM API concrete.
Both SAXBuilder and your XSLTransform rely on factories. It is always possible 
to add an extra layer to XPath so that the constructor will call 
XPath.newInstance !
> 8. Very important: Are the nodes returned live or not? We need to specify .
Live nodes.

Laurent




More information about the jdom-interest mailing list