Reply to Re: php 5 classes: public, protected and private

Your name:

Reply:


Posted by Tony Marston on 12/02/06 11:38

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:kv-dnVmk7pteu-3YnZ2dnUVZ_sednZ2d@comcast.com...
> Tony Marston wrote:
>> "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?
>>
>
> No, the fact that they are different are VERY RELEVANT. The fact you
> can't understand the difference is also VERY RELEVANT. Or is it just that
> you disregard facts which don't support with your stupidness?
>
> Losing the argument so you need to disregard the facts? Typical troll
> behavior.
>
> Whether or not a PHP interface is required is immaterial - we are talking
> about the OO concept of an interface, not PHP interfaces.
>
> But that's way too deep for you to understand - the same word having
> different meanings in different contexts? Hope your head didn't explode.

This is a PHP newsgroup, so I am explaining how interfaces work within PHP.
It is a simple fact that interfaces ARE NOT NECESSARY in PHP. The fact that
interfaces are treated differently in other languages is totally irrelevant.
The fact that YOU think that interfaces in PHP should behave exactly the
same as in other languages is also irrelevant.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация