in reply to Re^8: OO automatic accessor generation
in thread OO automatic accessor generation
I am suggesting--actually stating--that once classes have been properly unit tested, you only need verify parameters at the public/private interface.
The idea that you can unit test all possible inputs and all the possible permutations of their internal interactions, and that this is enough to ensure proper type usage, is just naive. It makes the assumption that the design will be frozen and especially in a language like Perl where a simple bit of anti-social code like *{BrowserUK::ClassFullOfAwesome::tested_method} = sub { ... } is possible, that is a bad assumption. This is not to say that in a disciplined shop where no one ever takes a shortcut due to an unrealistic deadline or idiotic business requirement this could not be true, but I have never heard of such a place. It has been my experience that when something that shouldn't happen happens, it is nice to have as much information as possible so that it can be reproduced and the whole plugged or bug squashed, retaining any and all type constraint checking in production means that I have all this information at my fingertips.
/me adds one more thing to his running list of "Things BrowserUK and I will never agree upon" ...
It called Design by Contract. Read Meyer and argue with him if you still disagree.
I like Meyer and have read him extensively, but he pretty much just talks about Eiffel and OO theory as it pertains to his idealistic Eiffel colored world. As for Design By Contract, I am not a huge fan, there are some good ideas but I much more prefer the type system of ML/Haskell. Of course the tradeoff is that polymorphism is much harder in ML and Haskell (Haskell typeclasses go a long way, but it's still not OO level polymorphism), but every language has it's pros and cons.
/me adds DoC and Meyer to the list now too ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: OO automatic accessor generation
by BrowserUk (Patriarch) on Nov 12, 2009 at 23:16 UTC | |
by stvn (Monsignor) on Nov 13, 2009 at 05:12 UTC | |
by BrowserUk (Patriarch) on Nov 13, 2009 at 10:29 UTC |