[jdom-interest] Factories for builders.

Paul Philion philion at acmerocket.com
Fri Mar 9 09:29:04 PST 2001

Ken -

I always prefer an interface (call it ElementFactory, for example) and a
default implementation (DefaultElementFactory). SaxBuilder could have either
a setElementFactory or an additional set of constructors (each having an
extra parameters: ElementFactory). Typical behavior would be to subclass
DefaultElementFactory and override the specific behaviors that you need.

- Paul Philion

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Ken Rune Helland
> Sent: Friday, March 09, 2001 12:14 PM
> To: jdom-interest
> Subject: [jdom-interest] Factories for builders.
> Hello all.
> On monday I will rewrite SaxBuilder to
> accept a factory to enable building of JDom
> trees with subclasses of the JDOM classes.
> I will of course post the modified SaxBuilder
> to the project for evaluation for inclusion
> into the main code.
> My current plan is to create an interface with
> methods matching the public constructors of the
> jdom classes and supply SaxBuilder with a default
> implementation that serves the original JDOM
> classes.
> Does anyone have any ideas and suggestions for
> a better approach?
> Especially am I wondering if the Factory should be
> a class or interface, is there any pros and cons?
> Best Regards
> KenR
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yourad
> dr at yourhost.com

More information about the jdom-interest mailing list