Hi!

On 9/19/11 1:33 AM, Pierre Joye wrote:
It is the same in C. A class extending an abstract class (or method)
does not extend it per se but implement it. Just like the foo(int a,
float b); is the declaration (abstract) and foo(int a, float b) {
return a * b;= the extended class. This is the basic of abstract
methods/classes.

There can be many implementations of the same protocol, that's the point of OOP (which has nothing to do with C or C function declarations, which and not overridable and as such do not define any protocols but just functions themselves). Your idea is that somehow only identically copying signatures instead of extending them is possible, and you intend to prove it referring to C as an example of object-oriented paradigms? Really.

This makes absolutely no sense, as there's no reason why MoreExtendedClass
can't extend domain of ExtendedClass. However, for some reason it is
prohibited.

Not willing to understand the declaration idea will only block this
thread forever.

Please do not assume I disagree with you because I am unable to understand you. I understand you perfectly well and you are wrong. You are claiming that only way in OO to implement contacts is have the whole hierarchy enforce exactly the same function signatures based on non-extendable "declaration" and overriding functions must have exactly identical arguments, domains and signatures. This is plain wrong - domains can be extended and overriding functions can accept more than the base protocol requires (and also this protocol is not the same as C declaration). Obsessive insistence on formal "enforcement" without understanding why this enforcement exists and what purpose it was supposed to serve just makes lives of programmers in PHP harder because they have to work around something that was supposed to help them, but instead impedes them. PHP is not C, and blindly applying C concepts to PHP OO constructs would not work.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to