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?


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.