Unwanted (?) exceptions in DDR Simple API spec

Dear Survivor of the DDWG (as Francois put it :-) )

A question I've been meaning to put to colleagues is ref the 
specification of Exceptions in the API. I've been working with a Java 
implementation for some time now and frequently end up with something 
like this:

try {
    pvv = service.getPropertyValues(evidence);
} catch (NameException e1) {
    // can't get here
    e1.printStackTrace();
}

for (PropertyValue pv: pvv.getAll()) {
    try {
       System.out.println(pv.getString());
    } catch (ValueException e) {
       // can't get here
       e.printStackTrace();
    }
}

It seems to me that there is a strong case for changing the exception 
types to avoid this unnecessary round the houses. Interestingly enough, 
though DDRException subclasses Exception in the supplied Java, it is not 
stated explicitly in the API documentation that this is the case. Would 
it be acceptable for a conforming implementation to have DDRException 
subclass SystemException, I wonder?

thanks
Jo

Received on Wednesday, 25 November 2009 15:06:10 UTC