At 11:31 AM +0900 7/30/01, Andy Clark wrote:
>There are a handful of different tree models out there in Java. >However, be *very* careful about what you pick and for what >reason. JDOM is based on a class hierarchy instead of interfaces >so it limits the extensibility and scalability of any application >written using it. Once you get past the learning curve for DOM, >you may find that you like it. Or not. But either way, make an >educated decision. > I've never quite understood the objection to the class hierarchy in JDOM as opposed to interfaces. Interfaces are perhaps marginally more extensible, but I've seen through experience that the vast majority of developers don't need the extra flexibility of interfaces, ever, especially when you remember that subclassing is still an option in JDOM's class-based hierarchy. Those few developers who do need the extra flexibility of interfaces, don't need it most of the time. I would completely disagree that interfaces are somehow more scalable. I see no evidence of that at all. Different implementations of DOM may be more or less scalable than JDOM (I've certainly seen ones that are less) just as different betas of JDOM have been more or less scalable than each other. The latest beta 7 is a huge improvement on previous betas in this area, which were already much more scalable than Xerces 1. Most importantly, most developers find interface-based designs to be confusing and hard to grasp. Class-based designs are much easier to follow, understand, and use. The participants in this mailing list are not representative of the DOM/JDOM user base. I teach this stuff frequently, and when I teach both DOM and JDOM to a novice audience, most students immediately grasp JDOM but have a really hard time coming to grips with DOM. When I teach JDOM to a DOM-literate audience, the sighs of relief are audible. Human factors are a very important aspect of API design, and one that has been almost completely ignored in the design of DOM. There are some real criticisms of JDOM, and some reasons one might prefer DOM for some more complex applications. However, using interfaces instead of classes is not one of those reasons. -- +-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | [EMAIL PROTECTED] | Writer/Programmer | +-----------------------+------------------------+-------------------+ | The XML Bible, 2nd Edition (Hungry Minds, 2001) | | http://www.ibiblio.org/xml/books/bible2/ | | http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java News: http://www.cafeaulait.org/ | | Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/ | +----------------------------------+---------------------------------+ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
