[jdom-interest] Re: Factories for Element creation

Jason Hunter jhunter at collab.net
Wed Nov 1 11:02:20 PST 2000


> Just to clarify...I'm not really talking about "special" elements 
> that know
> something extra that can be gleaned by parsing, but 
> rather app-specific
> overloaded elements that will information added to them after 
> the fact, not at creation time.

I suggest you use your own builder, or better yet work with us on
refactoring SAXBuilder to work well with subclasses.  All other
approaches require a fair amount of change to the core, and at the end
of the day we'd only would solve one small part of the actual problem
space.

> Of course, this is assuming that all Element properties
> can be set in JavaBean style, and don't have to be passed in the 
> constructor

Problem here is that's not the case, since we explicitly have no-arg
constructors "protected" so that users can't create non-well-formed
items, like elements without specified names.  Special casing to pass a
name is an option, but not a good one for the long term.

-jh-




More information about the jdom-interest mailing list