[jdom-interest] new element methods?
Phill_Perryman at Mitel.COM
Phill_Perryman at Mitel.COM
Thu Jul 17 00:13:51 PDT 2003
>>Such methods did make it into one of the betas a couple of years ago.
They were eventually removed on the grounds that there were just too
many methods in the class.
That sounds reasonable, I will stick to using my extended element class,
/Phill
IS Dept, Software Engineer.
phill_perryman at mitel.com
http://www.mitel.com
Tel: +44 1291 436023
Elliotte Rusty Harold <elharo at metalab.unc.edu>
Sent by: jdom-interest-admin at jdom.org
15/07/2003 20:35
To: "William Krick" <wkrick at eio-online.com>, <jdom-interest at jdom.org>
cc:
Subject: Re: [jdom-interest] new element methods?
At 10:07 AM -0400 7/15/03, William Krick wrote:
>I was wondering if it might be useful to add some methods to Element...
>
> getInt(java.lang.String name)
>
> getFloat(java.lang.String name)
>
> getBoolean(java.lang.String name)
>
> getString(java.lang.String name)
>
Such methods did make it into one of the betas a couple of years ago.
They were eventually removed on the grounds that there were just too
many methods in the class. While every such method seems plausible
and useful when considered in isolation, adding every convenience
methods requested rapidly grows the class to the point of
illegibility.
API size has a huge cost to ease of use, and there's a point at which
it begins to grow exponentially. The first five or six methods are
effectively free. The next five or six are worth the cost. Beyond
that the cost starts skyrocketing, and it gets much worse with each
batch of methods you add. 40 public members is really the effective
outer limit of a good class. Beyond that it's time to start asking if
you can refactor into more smaller classes. Element is already quite
large. It really can't handle the weight of a whole new batch of
convenience methods.
--
Elliotte Rusty Harold
elharo at metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030717/fae30497/attachment.htm
More information about the jdom-interest
mailing list