incubator-kato-spec mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Sterling <Nicholas.Sterl...@Sun.COM>
Subject Re: Kato API javadoc - error handling
Date Sat, 11 Apr 2009 05:48:53 GMT

Daniel Julin wrote:
> I guess a two mode approach would make everyone happy. But would it make
> the API too complicated?
I have some sympathy for what Steve is talking about -- maybe my 
short-term memory is small, but when lots of single lines of code 
inflate to 6 lines (and two indentation levels), it is definitely harder 
for me to read.  However, I wouldn't want to give up the certain and 
immediate catching of errors offered by exceptions.

Would a mechanism like this work for the two-mode approach?

    factory.setDataUnavailableHandler( new DataUnavailableHandler( ... ) {
    } );

All objects created by the factory would call that object's 
dataUnavailable() method when appropriate, passing it enough info about 
what was going on to allow the method to make interesting decisions 
about what to do.  The default handler would always throw a 

It's hard for me to tell whether something like that would really 
suffice in actual use.  Perhaps it would have to be finer-grained, with 
methods for javaObjectUnavailable(), imageSectionUnavailable(), etc.  
Perhaps the defaults for those would call the more generic 
dataUnavailable() so that you could intervene for all cases and/or for 
individual cases as desired.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message