Re: Beginner Tutorials for using CLASSES in PHP4

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

 



On 10/11/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
>
> 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 :)


im sure they chopped a few of them open; that is they analyzed the
implementation
directly, rather than looking at it as a black box and praying..

and i would still say the holes or openings the heart exposes are an
explicit interface
that the doctors do run a check against.  namely, how many holes are there,
and
do they correspond to the same holes on the human heart.

perhaps theres an implicit interface somewhere inside the implementation.
the pig
heart calls a method on a human blood cell that has to be there otherwise
something
doesnt happen and in the worst case a fatal error occurs and the person has
a stroke.

-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