Re: Classes - Dumb question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/12/07, Jay Blanchard <jblanchard@xxxxxxxxxx> wrote:
>
> No doubt. (are you by chance continuing the other argument, re:
> interfaces?), but you have to break open the original tested function, add
> code to it, test it, etc. Every time you add a new case you have to break
> open the existing function to add that case. After a while, say if you need
> to drop a customer type you would have to (not really, you can leave it
> there and never exercise the case) break open the original code and delete
> the un-used code. Any way that you slice it the original customer function
> becomes more and more like spaghetti every day. Documentation for the
> function has to change each time as well.
>
> With a class you can inherit all of the base class functionality into a
> new customer type. You do not have to break open the base class to add a
> case, you just have to create an extension class. Documentation is unique to
> each class.


Stut has demonstrated an example of delegation.  when used with objects,
inheritance is not necessary, but it can be used if desired.
use your polymorphic mechanism of choice :)

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux