[jdom-interest] Re: Fast or Safe?

Brett McLaughlin brett.mclaughlin at lutris.com
Fri Sep 1 07:46:53 PDT 2000


"Trebor A. Rude" wrote:
> 
> On Thu, 31 Aug 2000, Gerardo Horvilleur wrote:
> >"Trebor A. Rude" wrote:
> >>         Hmm, if we do that, we could create a sigleton factory class
> >> to return you the proper implementation of the interface based on some
> >> settings it's got stored. At the very least, the programmer would be
> >> forced to manually create objects of the correct implementation. Of
> >> course, either way would probably break every existing JDOM program out
> >> there, as the "Element foo = new Element("foo");" idiom would break.
> >> Even though we could, with the claim "the API is pre-1.0", I'm not sure
> >> many people would be very happy if we did that. Design wise, it sounds
> >> fine though.
> >
> >It would be something like: Element foo = factory.newElement("foo")
> >which seems reasonable enough to me. It is not too different from
> >what we have right now and it makes it possible to have multiple
> >implementations.
> 
>         It's quite reasonable, my only concern is that it probably breaks all
> existing code, which we may not want to do. Fortunately we're in the
> pre-1.0 stage, and it's easier to justify the large change. Brett? Jason?
> What do you think?

I continue to be against factories. It's unnecessary, I'm still
convinced. Because it is the first option apparant to perform this task
does not mean it is the best. It also makes implementation very messy,
breaks all existing code in a /fundamental way/, causes many of the JDOM
newbies to be totally lost, and AFAIK still doesn't add significant
functionality.

We went through this once every month or so, so I'd refer you to the
archives for more details... I'm so far from being convinced this is
even a good idea, though...

-Brett

> 
> --
> Trebor A. Rude
> trebor at bwn.net
> Registered Linux User #89308
> http://counter.li.org/
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org



More information about the jdom-interest mailing list