Jim Lucas wrote:
Rihad wrote:
Now will you mentally copy and paste the above code several times,
doing the necessary text substitutions, what will you get? Three
identical copies of doSetColumn() in each class! And the real
doSetColumn() is a bit heavier than a one-liner. We come full circle.
I don't understand, which part(s) are you copying multiple times? Foo,
FooBase, all the above...
if you are talking about having multiple Foo classes with one common
FooBase class for each that they all inherit then it would be simple,
move soSetColumn() to the FooBase class.
[snipped]
In short: there are several sets of Xxx, XxxPeer, BaseXxx, BaseXxxPeer.
The long and uncut story: please take a look at how Symfony and more
specifically its ORM Propel does things to better understand the
nightmare I'm talking about. Computers don't have a hard time with code
duplication when generating source code: they can always scratch things
and start anew in a second (or half a second on a dual-cpu box). Code
generation is the latest hot topic that lays the "Web 2.0" buzzword
hands down. The funny part starts when humans, who are not really good
at code duplication, try interfacing with the kilobytes of generated
masses of source code at the API level. You find yourself repeating code
everywhere, and it occurs so naturally that you begin to kind of like it
that way. Just kidding.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php