RE: [PHP] Beginner Tutorials for using CLASSES in PHP4

From: Date: Thu, 11 Oct 2007 13:46:52 +0000
Subject: RE: [PHP] Beginner Tutorials for using CLASSES in PHP4
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-263097@lists.php.net to get a copy of this message
On Thu, 2007-10-11 at 07:19 -0500, Jay Blanchard wrote: > [snip] > 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 ;) > [/snip] > > No doubt they are syntactic sugar (and not needed for polymorphism), PHP > and other languages are sprinkled with such spices. And just like spices > these things have a proper place and usage. (Unless I am slow cooking my > world famous brown sugar and cinnamon brisket.) Given the class brisket > that extends meat I would likely use an interface to implement said > world famous brisket just as others might implement an interface for > their brisket. Of course my recipe could be a child of brisket, but may > violate the IS_A relationship unless a recipe is implicitly implied for > each brisket. Sometimes this syntactic sugar makes for cleaner code > (especially when others who are not aware, sometimes folks do it just to > do it. YMMV and I am now hungry. > > BTW, pigs hearts and other body parts are used extensively in research > where human physiology is concerned because of their similarity. And how do you think "similarity" was determined? Most likely by trying options until something worked :) Cheers, Rob. -- ........................................................... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ...........................................................

« previous php.general (#263097) next »