Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20272 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86893 invoked by uid 1010); 23 Nov 2005 17:52:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 86877 invoked from network); 23 Nov 2005 17:52:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2005 17:52:23 -0000 X-Host-Fingerprint: 194.109.193.120 unknown Linux 2.4/2.6 Received: from ([194.109.193.120:36756] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id CB/4C-11378-75CA4834 for ; Wed, 23 Nov 2005 12:52:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id 842F4186FFD; Wed, 23 Nov 2005 18:52:24 +0100 (CET) Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23503-13; Wed, 23 Nov 2005 18:52:23 +0100 (CET) Received: from [192.168.1.16] (bspr.xs4all.nl [194.109.161.228]) by mx1.moulin.nl (Postfix) with ESMTP id E4901A7733; Wed, 23 Nov 2005 18:52:22 +0100 (CET) Message-ID: <4384AC51.2060805@iamjochem.com> Date: Wed, 23 Nov 2005 18:52:17 +0100 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christian Schneider Cc: internals@lists.php.net References: <00A2E2156BEE8446A81C8881AE117F192C1C4E@companyweb> <43838433.3080404@lerdorf.com> <43849103.60307@iamjochem.com> <438499A8.7030900@cschneid.com> In-Reply-To: <438499A8.7030900@cschneid.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at moulin.nl Subject: Re: AW: AW: [PHP-DEV] PDM Meeting Notes From: jochem@iamjochem.com (Jochem Maas) Christian Schneider wrote: > Jochem Maas wrote: > >> so I can only assume that the ability to declare ctor signatures have >> been left in because they do no harm regardless of whether it is >> 'correct'. > > > If I remember correctly then one reason to have constructor signatures > is for object factories: You specify that an object to be created by a using an object factory its quite feasable under certain conditions to make the ctor protected to force the use of the factory - the same applies to singleton implementations. hence I don't that a ctor is by its definition public - although, granted, in the normal case it usually so. > specific factory has to follow certain constructor rules. I see nothing > wrong with that, it is part of a public interface of a class and hence > one should be able to specify it in an interface. > >> abstract static protected function __construct(CrazySettings $s, >> CrazyView $v); > > > Abstract is purely redundant here as interfaces never implement a > function. If on the other hand you mean that classes _implementing_ this > interface have to declare those methods as abstract then I don't see how > anyone could actually use this interface as no non-abstract class could > implement these functions in the interface. right - I merely meant that the 'abstract' keyword was harmless and could safely be ignored by the engine if used in this context. > > Static doesn't really make sense as interfaces as object instance related. that is a matter of consensus (if the accepted software design paradigms change that may very well be considered bullshit in the future) - is there any solid technical reason that the ability to declare an interface method as static? if not then why change the behaviour? (not to mention that it happened in a minor version - going from 'working' to E_FATAL is a rather drastic change for a minor version upgrade). > > As far as protected and private go I have less strong of an opinion but > I understand the point of view that interfaces describe the _public_ > interface of an object, everything else are implementation details. I understand the point of view as well, I understand it very well thanks. but I'd like to throw back an argument often used by core developers: 'if you don't like it you don't have to use it' So rather than forcing me to change my previously working code just don't used protected/private/static in _your_ interface declarations. and if you ('you' in general!) really really must impose such purism then either impose it from the start (shitty argument I realise!) or at least let me determine _when_ I fix my code (rather than being _forced_ to stay late at work and not be able to see my son - which has happened to be my reality with respect to abitrary changes in php on more than one occasion) byt giving me an E_STRICT rather than an E_FATAL, an E_FATAL I have to fix otherwise i lose my client, with an E_STRICT I can go home and worry about it tomorrow. AND BESIDES: there is is nothing in the word 'interface' that implies the concept of public - going back to your own factory example - its very handy to be able to allow the the actual factory to conditionally call (or trigger the calls to) certain methods on the objects its generating/creating that are only relevant to the setup/init of said objects - imho the neatest way is to use interfaces, and the neatest way to stop anyone from using the relevant method once the object has been created and returned to the callee is to make it protected (this assumes, in the simplest case, that the factory is also the base class for all the classes of the objects it produces - which is not an impossibility). > > - Chris