|
Posted by Curtis on 12/03/06 07:00
> That's just your opinion. Where does it say that I *MUST* define and use an
> interface before I can access a class method? Interfaces are optional
> (especuially in PHP) so it is not wrong to excercise the option NOT to use
> them. I can define a class method and access that method without using an
> interface, and that is what I choose to do.
No one is saying that you have to use interfaces. The point is that it
is there to help in organizing and creating classes, the same goes for
visibility keywords. Just because you don't have to use these, doesn't
mean that you should not use them.
I can see an advantage in using interfaces and/or visibility keywords
in PHP, if one is creating a large library, or to help communications
between a team of developers. These features can help track down where
a problem is if something isn't working right, or just for clarifying
the particular usage for the class or its members.
BTW, I do not believe there is any controversy over what encapsulation
is; if so, I haven't heard about it.
Navigation:
[Reply to this message]
|