Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
Frankly, I find avoiding duplicate code in Java to be a pain. I can't tell you how many times my perfectly sensible refactor has been tripped up by exception handling. I'd love to be able to pass around deferred bits of code. No such luck. In my database code, I seem to have a few sections of code that have identical try/catch blocks around them, but since the code on the inside of the try block is not the same, I can't seem to pull it out -- unless I wrap it in the try/catch blocks I'm trying to refactor. Am I just not getting the hang of software design in Java or is it always this bad?
unchecked exceptions (Score:2)
Re:unchecked exceptions (Score:2)
Er, are you saying that my design doesn't have a fundamental flaw? I find it hard to believe that a language is set up in such a way that I can't factor out common code.
Re:unchecked exceptions (Score:2)
No, I'm just saying that one way around it is unchecked exceptions. I can't say one way or another about your design without actually seeing it :-) Unchecked exceptions can also be a way of sweeping problems under the rug.
But the Spring items I mentioned earlier are one way to get around these sorts of design issues even if you don't consider the unchecked exception part. There are a couple of examples at devx [devx.com], and the Spring docs (esp. the PDF [springframework.org]) are generally excellent and have examples as well. (See sect
Re:unchecked exceptions (Score:2)
Oh, yeah, I didn't post a code snippet :) The essense of my problem [javajunkies.org] is posted on Java Junkies [javajunkies.org]. (I should really find a better site for posting Java stuff, I hate to admit.)
Re:unchecked exceptions (Score:1)
http://codepaste.org/