[jdom-interest] JDOM JSR

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu May 17 08:46:33 PDT 2001

> And its not just factories but a lot of GOF-Patterns, that depend on
> interfaces.

There are some patterns that are hard to do without interfaces, but not all.

> I noticed JDOM quite a while ago, but just started to evaluate it
> (without doing any testing myself). I don't think list 
> archives are the
> appropriate place for the documentation of design decisions. 

That would be nice...
> OK, but if you need MostMemoryEfficientImpl: How can you get it? Don't
> you have Element as a super class with all its memory 
> consuming, useless
> fields?

Here are Element's 8 fields you can't do anything about.  None are
instantiated in the default no arg constructor.  I would have trouble
imagining any implementation that wouldn't have to use at least some of
these fields.  All of the other classes have less fields.

    private static final String CVS_ID =
    "@(#) $RCSfile: Element.java,v $ $Revision: 1.76 $ $Date: 2001/05/09
17:25:38 $ $Name:  $";

    /** The local name of the <code>Element</code> */
    protected String name;

    /** The <code>{@link Namespace}</code> of the <code>Element</code> */
    protected transient Namespace namespace;

    /** Additional <code>{@link Namespace}</code> declarations on this 
        element */
    protected transient LinkedList additionalNamespaces;

    /** Parent element, or null if none */
    protected Element parent;

    /** The Document containing this element, if it is the root element */
    protected Document document;
    /** The attributes of the <code>Element</code> */
    protected List attributes;
    /** The mixed content of the <code>Element</code> */
    protected LinkedList content;

> ... and I don't have your experience so I cannot judge about the
> importance of that drawback.
> But I still did not understand the drawback of an interface 
> approach. I
> guess I have to dive into the list archive.

Many agree with you.  Based on my own experience and the numbers of people
using JDOM, I would guess that more do not.  Fact is that probably 90% of
developers have never heard of Abstract Factory, Decorator, Kit and other
useful patterns.  And fortunately, there are alternatives, including DOM
that allow you to pick and choose what matters most to you.

More information about the jdom-interest mailing list