Re: Beginner Tutorials for using CLASSES in PHP4

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

 



On 10/10/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
>
> What I was really illustrating is how interfaces are syntactic
> sugar only. In my above example what I've really shown is an
> implicit interface :) Since OOP is largely meant to model real
> world things, ask yourself this... when a doctor sews a pig's
> heart into a human, do you think there's an explicit interface
> someplace that checks for compatibility, or does it "just work"
> if the conditions are right. Food for thought, pork in fact ;)


i would look at that as a great example of an interface in action.
the pigs heart has to be compatible with the human body in some
way; they both have the same interface; namely the holes the tubes
connect to.  i assume the doctors are the ones who run the interface
compatibility check.
the implementation is different i suppose (im not a biologist, just
guessing here :))  but thats the beauty of an interface; you just get
a contract, not behavior.

-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