Re: Insult my code!
| From: | David Otton | Date: | Wed, 07 Oct 2009 22:31:58 +0000 |
| Subject: | Re: Insult my code! | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298758@lists.php.net to get a copy of this message | ||
2009/10/7 Paul M Foster <paulf@quillandmouse.com>:
> I think this is a bit extreme. It really depends on what's in your
> parent model class. It could be something really simple, but something
> you don't want to have to rewrite in every model you code. Thinking that
Have you got an example of something that is needed by every model
that interacts with a general-purpose framework?
> 1. It keeps me from having to rewrite the same code over and over
> (inheritance).
Inheritance isn't the only mechanism for code-reuse, but it is the
most tightly bound. In some situations it may be the appropriate
solution, but it does force you into a taxonomy straightjacket. You
just need to be aware of that, and pick the appropriate tool for the
job.