The reason a "Node" interface is of so much iterest to me is that I can then have JDOM-related type-safety in my own code that utilizes JDOM's classes: you may not see the reason for it within JDOM but not having a common "placeholder" interface for your JDOM classes makes my client code ugly and un-type-safe (having to pass Objects around instead of JDOM Nodes which means anything can be passed to my methods and that we have to rely too heavily on javadoc and runtime debugging to "guide" the usage of our code).> - There is no common base class for all objects in the document model. This > means that serialization and equality methods have to be written somewhat > piecemeal. I'm sure that you've considered a common root class. I'm > curious why you choose to reject it for the API. It's a good idea in general, but gets messy when you try to implement it. There's almost no common functionality across all the object types, so you'd have a Node interface that's nothing but a blank marker. That not much of an advantage over Object. In the end we went with Parent and Content since there is some overlap between parent classes and child/content classes. Of course, you heard someone this morning say they wish we hadn't. You can't please everyone here.
|
-- Phil Weighill-Smith <phil.weighill-smith@volantis.com> Volantis Systems |