Re: OOP Interfaces



FutureShock wrote:
I have been coding PHP for well over 10 years and its sad that I am just now beginning to learn how to use Classes with it. The more I use the Classes the more I am really beginning to love them, so I am trying to expand my knowledge of them.

I started reading on Interfaces and I understand HOW to use them, but I am really foggy on WHY to use them.

From my perspective and Interface, since it has no actual functionality, provides nothing more then a strict template of what must be used in a Class that Implements it. Sort of like XSD for XML.

Is this a right assumption?

What other benefits do Interfaces serve?

Scotty

Basically, yes, Scotty. Interfaces are more important in strongly typed languages such as java. They ensure that the implements the necessary methods.

As you know, PHP is a lot less strongly typed. But interfaces are still important, for the same reason.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: OOP Interfaces
    ... Jerry Stuckle wrote: ... What other benefits do Interfaces serve? ... Basically, yes, Scotty. ...
    (comp.lang.php)
  • Re: OOP Interfaces
    ... Interfaces serve no useful purpose whatsoever IMHO. ... signature and call it without having to define an interface, ... This feature has been put into PHP for no reason than to satisfy ...
    (comp.lang.php)
  • OOP Interfaces
    ... I have been coding PHP for well over 10 years and its sad that I am just now beginning to learn how to use Classes with it. ... I started reading on Interfaces and I understand HOW to use them, but I am really foggy on WHY to use them. ... What other benefits do Interfaces serve? ...
    (comp.lang.php)