|
Posted by Tony Marston on 12/01/06 09:30
"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:DuWdndxBr5xeRfPYnZ2dnUVZ_vidnZ2d@comcast.com...
< snip>
>>>>>The PHP interface defines a set of methods (function) which are
>>>>>required by the classes which implement the interface. Java is similar
>>>>>in that respect. But both are a subset of the total interface.
>>>>
>>>>
>>>>It is possible to access the method directly without an interface,
>>>>therefore an interfae is not necessary.
>>>>
>>>
>>>"Possible" != "CORRECT"
>>
>>
>> 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.
>>
>
> When are you going to get it through that pea-sized mind of yours that a
> PHP interface is not the same as an interface as defined in OO terms?
>
> In OO terms, a public method is part of the interface. The PHP keyword
> interface just defines a set of functions which must be implemented by the
> class.
>
> They are two entirely different things.
The fact that a method and an interface are different things is irrelevant.
I am just pointing out that in PHP an interface is not necessary as I can
access the method directly without going through an interface. Is this
statement true or false?
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Navigation:
[Reply to this message]
|