org.jdom2.xpath.XPath has a poor model for setting the 'factory' #42

rolfl opened this Issue Sep 17, 2011 · 1 comment

1 participant


This package should have a proper 'factory' pattern.

The current problem is that it is impossible to have a reliable mechanism for setting the 'backing' XPath factory. If one area of code were to ever need a 'custom' XPath 'engine' then they could set the engine with the XPath.setXPathClass(), but this would impact all areas of the program, not just the part that needed the change.

Further, these other areas would be unable to check what factory they have, and, worse again, if issue #41 is fixed, that other area of code can be set to use the JaxenXPath factory again, but that will 'break' the original area that wanted the custom factory anyway.

A proper factory pattern needs to be used.

@rolfl rolfl closed this Dec 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment