Re: How to drop this exception?




"Ikke" <ikke@xxxxxxx> wrote in message news:Xns9849DB46A2283ikkehierbe@xxxxxxxxxxxxxxxxx
"Oliver Wong" <owong@xxxxxxxxxxxxxx> wrote in
arSRg.32826$bf5.11259@edtnps90:">news:arSRg.32826$bf5.11259@edtnps90:

<snipped>
c) pass in the name of a class which needs to be instantiated (best
option I guess)

Possible, but this uses reflection, and generally it's better to
use a
non-reflective solution in preference to a reflective one.

Is there a special reason you can't just catch (or throw) the
exception?

Yes - it seems sloppy.

The entire reason for using the third party package is to "hide" all the
database stuff (and it's exceptions).

So it's pretty stupid to use a package to hide all that database specific
stuff, if you still have to use the exceptions in order to create objects
to pass to said package!

Personally, I'd prefer NOT to hide the exceptions at all, and just catch
them where they need to be caught.

Without seeing the API of the package your using, I recommend you catch (or throw) the exception.

- Oliver

.



Relevant Pages

  • Re: Repositories, package dependencies, and domain-flavoured exceptions
    ... Always return a customer. ... > particular kind of Customer using an Account Number. ... The Repository is in the "domain" package, the exceptions are ...
    (comp.object)
  • Package organisation question.
    ... I maintain a small package for talking to the API of BulkSMS.co.uk. ... have been adding support for some new features recently, ... all derived exceptions that my package throws. ... I am now adding support for 2-way SMS to the ...
    (comp.lang.python)
  • Re: Repositories, package dependencies, and domain-flavoured exceptions
    ... The Repository is in the "domain" package, the exceptions ... > are in the "command" package. ... where are your Customer and Account classes, ...
    (comp.object)
  • Re: HA Javamail not handling exceptions
    ... into HAJavamail and try and throw the exceptions so I can catch them ... I guess rebuilding someone else's package is a skill I ... The ultimate issue is they are catching the exceptions in various ... exactly what I do with Beta code! ...
    (comp.lang.java.programmer)
  • Re: How to drop this exception?
    ... Possible, but this uses reflection, and generally it's better to ... database stuff (and it's exceptions). ... So it's pretty stupid to use a package to hide all that database specific ...
    (comp.lang.java.help)