>>> On Thu, 21 Jun 2007 12:59:55 +0200, Petterson Mikael
>>> <mikael@no.reply.to.se> wrote, quoted or indirectly quoted someone who
[quoted text clipped - 26 lines]
>
>Pan
Also agreed. Just did this and used the classloader to load the properties.
Wish I knew a bit of Spring - with all the exceptions that could be thrown and
wanting to default to the production value if things went wrong, the little
bit of code I wrote was very ugly. It would be nice to inject the value,
though Spring would likely be overkill for this.
Eric
Lew - 22 Jun 2007 04:33 GMT
> Also agreed. Just did this and used the classloader to load the properties.
> Wish I knew a bit of Spring - with all the exceptions that could be thrown and
> wanting to default to the production value if things went wrong, the little
> bit of code I wrote was very ugly. It would be nice to inject the value,
> though Spring would likely be overkill for this.
If you think handling Exceptions is ugly, try not handling them.
I swear half my production code is comments, half of what remains is safety
checking for things like argument boundaries or wild calculations, half of
what's left after that is exception handling, half of what remains after that
is logging, and only the bit that remains after that actually does the
"happy-path" logic.
The "real world" is fraught with conditions for which your code must be on
guard. Just because it's lengthy doesn't make it ugly. Just because it's
hard work doesn't mean you should skimp on it.

Signature
Lew