On Wed, Jul 6, 2011 at 2:40 PM, Vincent Le Guilloux
<[email protected]> wrote:
> I would also roughly go to the Nina's solution, with a strong
> agreement with Rajarshi. Just a few additional word to enrich this
> interesting discussion:

Agreed. We'll have to aggregate the common types...

I like the suggested CDKFormatException and CDKInputException, for example.

I guess we'll also have CDKMissingInformationException.

That should be granular enough.

> Too much exceptions handling / types usually gives verbose code (JAVA
> is verbose enough hu... ;)), endless try/catch at every level of the
> code, and bad performances.

That makes this perhaps good timing, as Java7 has "multicatch":

http://bugs.sun.com/view_bug.do?bug_id=6943289

<snip>

> Let's take a concrete example in the CDK: when computing 3D
> descripors, most of the classes in charge of computing such
> descriptors will check that the input molecule actually has 3D
> coordinates, and throw an exception otherwise.

Actually... there we have a different mechanism, and just return NA :)

> In my opinion, this way of catching errors at such a low level is,
> among others, a waste of CPU time. Let's suppose I read a molecule,
> and I want to compute all 3D descriptors available in the CDK. How
> many times  the
> 3D coordinates verification will be performed ? Probably it would have
> been a good idea to check this before (up to the user then) it makes
> much more sense imho :)

Yes, that's why I mentioned that complementary rule that we must have
matching CDK APIs to see if we can expect that exception to happen.
For missing information this is easy.

> Anyway, I think one have to be carefull about these things. Too much
> code, too much check... render the final program harder to read /
> understand, and computationally inefficient.
>
> I know, that's easy to say... but still :)

We'll get there :)

Egon

-- 
Dr E.L. Willighagen
Postdoctoral Researcher
Institutet för miljömedicin
Karolinska Institutet (http://ki.se/imm)
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to