Re[2]: [PHP-DEV] protected interface methods
| From: | (Marcus B�rger) | Date: | Thu, 03 Jul 2003 16:28:59 +0000 |
| Subject: | Re[2]: [PHP-DEV] protected interface methods | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3209@lists.php.net to get a copy of this message | ||
Hello Jan,
Thursday, July 3, 2003, 6:15:04 PM, you wrote:
JS> Zitat von Moriyoshi Koizumi <moriyoshi@at.wakwak.com>:
>> marcus.boerger@t-online.de (Marcus Börger) wrote:
>>
>> > Hello internals,
>> >
>> > It is of course correct that an interface method cannot be declared
>> private
>> > but i think it should be possible to declare it protected.
>>
>> I don't see the benefit to allow interfaces to have protected methods as
>> I
>> use abstracts for that purpose. What's your point?
JS> Agreed. As the name implies "interfaces" define interfaces to the outside
JS> not to extending classes.
Not really. An interface simply describes a protocol subset that must be part
of the implementing class's protocol. In that it makes no sense to allow final
or private methods in an interface but still a protected member in an interface
would describe a subset of a protocol. And hence it would describe a method
that must be available with protected or public visibility. Or in other words
it would make it possible to hide a method per default from outside.
"A derived class must implement it but other classes are not supposed to use
it"
I came across this when i experimened with __clone.
--
Best regards,
Marcus mailto:helly@php.net