“While defensive programming effectively guarantees the condition of a method’s input, it becomes repetitive if it is pervasive across a series of methods. Andrew Glover shows you an easier way to add reusable validation constraints to your code using the power of AOP, design by contract, and a handy library called OVal.”
Same old problem different name. This is design by contract and it’s been around since the mid 80s.
http://www.eiffel.com/developers/faqs/eiffel-language.html#classic-…
Same old problem different name. This is design by contract and it’s been around since the mid 80s.
They already mentioned design by contract (There is a whole section on it). And AOP is an efficient way to enforce the contracts on Java language code.
(AOP is also very effective at other topics like logging, security, etc. If I were you, I’d not miss the reading).
Yet, not reading the linked article is understandable. But not reading the summary is way beyond.
add reusable validation constraints to your code using the power of AOP, design by contract, and a handy library called OVal.”
He probably read it. I did… and the first thought I had was “just use eiffel.” But yes, it does seem to have a pretty streamlined interface and the setup does not appear to be too difficult.
I always liked the design principles used by Grady Booch… when you design data structures, classes, etc. — make sure you design the errors into it as well. I am not saying that very well, but what I mean is know what can go wrong at the point you design it and make it part of the class.
But I also understand what this product does is sort of give you a way to control the incoming/outgoing data/behavior with one-stop shopping and non-repetitive coding exercises.
…cracks me up. Seriously now, replacing a NullPointerException with an exception that is higher up in the hierarchy is just wrong. The NullPointerException carries more information with its type than the more generic RuntimeException.