Maybe this is old news for Java zealots, but i’m a newbie and i iwill try to get better in everything that i do.
I really dislike the way some of the legacy code at the company where i work it’s written: they have some validation conditional statements to check for methods parameters or any validation in some places. The code will improve a lot by throwing good and descriptive warning messages to the client user of our method.
I don’t think this will be the best solution but i will begin to use it on the code i write becuase one line of code is simpler to maintain than and entire conditional statement and i just have to handle the Exception in the caller code.
I found the Apache Commons project a long time ago and never took the time to look deeply at it. They have a lot of commons problems resolve for us to reuse, like the one to solve this validation problem in methods parameters the utility is part of the Commons Lang here is the code:
June 30, 2009, 11:29am Comments