Re: Beginner Tutorials for using CLASSES in PHP4

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

 



On 10/10/07, Tony Marston <tony@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
> ""Jay Blanchard"" <jblanchard@xxxxxxxxxx> wrote in message
> news:56608562F6D5D948B22F5615E3F57E690357FCB7@xxxxxxxxxxxxxxxxxxxxxxxxxx
> [snip]
> >> so what are the benefits of the "with interfaces" solution over
> >>the"without interfaces" solution
> [/snip]
>
> > Polymorphism.
>
> Are you saying that it is not possible to have polymorphism without using
> interfaces? If so you are very much mistaken.
>

no, but what you still havent been able to grasp is the alternate
polymorphic facility that interfaces offer.

how would you do the lawnmower w/o interfaces?  use arrays instead, for
grass and human hand,
then you loose polymorphism.
if you instead make human hand and grass extend from a common base class
then youre combining the
passing the behavior of some strange parent class to two mostly unrelated
children.

-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