[jdom-interest] NoSuch*Exceptions in JDOM

Elliotte Rusty Harold elharo at metalab.unc.edu
Wed Jul 12 04:25:38 PDT 2000


At 10:30 AM -0700 7/10/00, Jason Hunter wrote:
>> Would the JavaBean convention forbid "mustGetChild"
>> even if there is already a "getChild"?
>> How about:
>>   getMandatoryChild - may throw NoSuch*Exception
>> or
>> getOptionalChild - may return null
>
>This approach is starting to have a small amount of appeal to me.
>Instead of choosing to install "vi" or "emacs" maybe we should install
>both.
>

I just really don't like this. It smells to me of Perl where there's 
more than one way to do it (and generally several dozen ways). I'd 
really prefer to keep the API smaller, simpler, and easier to grasp. 
I can go either way on the null  or exception, but whichever way we 
go I'd like to stick with it.

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list