Em Mon, 19 Sep 2011 10:56:03 +0100, Etienne Kneuss <col...@php.net>
escreveu:
Apparently you guys are speaking about the initial implementation of an
abstract method, while I was talking about overriding a method, which is
not the relly same. So the above doesn't really apply.
The initial implementation of an abstract method should match the
signature,
while overriding a method should be able to loosen the precondition in
many ways (type hints change, less arguments, etc..), IMO.
I should like to hear why. As far as I can see, there's absolutely no
difference. All I've seen in this thread to this respect are semantic
pseudo-arguments.
I'd say interfaces are much more likely to include more useless parameters
than a concrete method definition, which most likely will only include the
arguments it actually needs.
An example:
http://www.google.com/codesearch#HmA4mAI_aLc/src/main/java/terrastore/server/impl/support/JsonBucketsProvider.java&q=implements%5C%20MessageBodyWriter&type=cs&l=36
This is the most common scenario for implementations of this interface
(see the other search results).
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php