|
Posted by Tony Marston on 12/03/06 09:47
"Curtis" <dyer85@gmail.com> wrote in message
news:1165129247.178830.167100@80g2000cwy.googlegroups.com...
>> 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.
Exactly. All I am saying is that interfaces are not necessary, just as the
use on private/protected is not necessary. Others keep arguning the
opposite.
> 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.
To some people encapsulation means "implementation hiding" while to others
it means "information hiding". This is discussed in the following documents:
http://www.itmweb.com/essay550.htm
http://homepage.mac.com/keithray/blog/2006/02/22/
http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html
There is no single view as to what OOP actually IS or IS NOT. People cannot
agree on what the basic terminology means, which leads to greater arguments
on how it should be implemented.
There are some people in this newsgroup who do not like views which differ
from their own. They consider their way to be the RIGHT way, the ONLY way,
just like religious fanatics. All I am trying to do is point out that there
is no single truth, no single point of view.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
[Back to original message]
|