Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55547 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72408 invoked from network); 19 Sep 2011 10:40:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2011 10:40:21 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-ew0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:43096] helo=mail-ew0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/00-14600-31C177E4 for ; Mon, 19 Sep 2011 06:40:20 -0400 Received: by ewy28 with SMTP id 28so2121273ewy.32 for ; Mon, 19 Sep 2011 03:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=aUFi57EimcrRnwOa7EE3atPB9l/frhSevRCQ2Uvk4vo=; b=nrAIrJmV5nhI4ab5Zc8eE1fJ5r5lol+CIDt8f3SKDhELaMwxsPn9ymCJsyXbqbuX9J YLprn6RGkLTrLpFtKxnynEmkSiZxqHP6wt//QOF6Tf6sH4P2rzNRHElf58Wqg8zdE9/z ejPImqQ/euwvO+vQAIFbGn+gKuNmZrbEsPkz4= MIME-Version: 1.0 Received: by 10.204.128.139 with SMTP id k11mr1465749bks.27.1316428816819; Mon, 19 Sep 2011 03:40:16 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.59.68 with HTTP; Mon, 19 Sep 2011 03:40:16 -0700 (PDT) In-Reply-To: References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> <4E7685DE.6010805@sugarcrm.com> <4E768C86.3030307@sugarcrm.com> <4E769418.6040200@sugarcrm.com> <4E770163.2090001@sugarcrm.com> <4E770770.60809@sugarcrm.com> Date: Mon, 19 Sep 2011 12:40:16 +0200 X-Google-Sender-Auth: Q6jX7W3-RMso7K4M6oh1RIScBDg Message-ID: To: Gustavo Lopes Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0015174c113cffa70604ad48f76e Subject: Re: [PHP-DEV] __constructor parameter limitations. From: colder@php.net (Etienne Kneuss) --0015174c113cffa70604ad48f76e Content-Type: text/plain; charset=UTF-8 Hi, On Mon, Sep 19, 2011 at 12:18, Gustavo Lopes wrote: > Em Mon, 19 Sep 2011 10:56:03 +0100, Etienne Kneuss > 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. > Well it is about semantics, and IMO defining a method as abstract is some sort of declaration, and this declaration should be respected when the method is actually implemented. On the other hand, interfaces define usage capabilities, and those usages should work. There might be close to no difference in the way the are internall handled currently, but IMO there is a semantic difference between the two. > 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 > > -- Etienne Kneuss http://www.colder.ch --0015174c113cffa70604ad48f76e--