On Tue, Mar 19, 2002 at 01:34:38AM -0800, Michael Brennan wrote: > [EMAIL PROTECTED] wrote: > > <snip/> > > > I'd propose that the base class itself be made generic. IOW, > > > > * combine JaXPath and BaseXPath > > > > * rename BaseXPath to XPath (yes, another object named XPath, sigh) > > > > * make it introspect on the parameter to figure out what type of > > Navigator to instantiate. > > I'd like to request that this *not* be done, if I may. I'd prefer to > keep an abstract base class like BaseXPath, and make the generic XPath > implementation a separate subclass. I'm using Jaxen, in one instance, > with my own object model. I think it would be much cleaner to be able to > subclass an abstract class that has no dependencies on EXML, JDOM, DOM, > or dom4j, and keep those dependencies out in a separate subclass. > Unifying JaxPath and BaseXPath sounds fine to me. I wouldn't mind > renaming or refactoring, but I like having an abstract implementation > with no dependencies on any particular object model. I think it would be > good to keep that in there.
I see where you're coming from, but I don't think you have to worry. The dependencies would be isolated to a single method (getNavigatorForObject I think is what I proposed calling it). If I used the java.lang reflection classes, then this dependency would be invisible even to the compiler. You could then subclass BaseXPath (renamed) exactly like you already are, and you could even include the source code in your project. The thing is, the "dependencies" right now is exactly one dependency -- which Navigator to instantiate? -- and it's IMHO more confusing to have four extra nearly-empty subclasses than to have a slightly smarter superclass. I suppose it would be possible to split the dependent method off into its own subclass, but I don't see a compelling use case for that. Using your own object model would be no problem. Can you spin another use case, or is it just a general sense of unease? - A -- Alex Chaffee mailto:[EMAIL PROTECTED] jGuru - Java News and FAQs http://www.jguru.com/alex/ Creator of Gamelan http://www.gamelan.com/ Founder of Purple Technology http://www.purpletech.com/ Curator of Stinky Art Collective http://www.stinky.com/ _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest