Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51024 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21705 invoked from network); 14 Dec 2010 02:27:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2010 02:27:09 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 76.96.30.64 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 76.96.30.64 qmta07.emeryville.ca.mail.comcast.net Received: from [76.96.30.64] ([76.96.30.64:59272] helo=qmta07.emeryville.ca.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/83-28678-CF5D60D4 for ; Mon, 13 Dec 2010 21:27:09 -0500 Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta07.emeryville.ca.mail.comcast.net with comcast id ildC1f0031zF43QA7qT5hh; Tue, 14 Dec 2010 02:27:05 +0000 Received: from earth.ufp ([98.220.236.211]) by omta24.emeryville.ca.mail.comcast.net with comcast id iqT41f00C4aLjBW8kqT5HY; Tue, 14 Dec 2010 02:27:05 +0000 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id 72D4AD7A65 for ; Mon, 13 Dec 2010 20:27:04 -0600 (CST) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 345IaJuY+ZUg for ; Mon, 13 Dec 2010 20:27:04 -0600 (CST) Received: from linux-nkec.site (unknown [192.168.42.1]) by earth.ufp (Postfix) with ESMTPSA id 5D97CD7A13 for ; Mon, 13 Dec 2010 20:27:04 -0600 (CST) To: internals@lists.php.net Date: Mon, 13 Dec 2010 20:27:59 -0600 User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.4.4; x86_64; ; ) References: <89C52156-CF92-4DDB-8BA4-4ABF6883512C@stefan-marr.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <201012132027.59678.larry@garfieldtech.com> Subject: Re: [PHP-DEV] Traits and Properties From: larry@garfieldtech.com (Larry Garfield) On Monday, December 13, 2010 10:02:13 am Stefan Marr wrote: > However, since traits do not provide any safety provisioning for state, > i.e., there is no collision handling for properties, the question is, how > do we either promote to use explicit accessors or how do we deal with the > inevitable and certainly justified use of properties in one or the other > way. > > Best regards > Stefan Thinking about it, I'm not sure that accessors are really a solid solution either. Behavior has to have something to behave on. So whether you have $this->foo or $foo = $this->getFoo(); // Do stuff with $foo $this->setFoo($foo); You still have a dependency that the composing class have either a property named $foo or a pair of (frankly pointless) get/set methods. So either a composing class needs to know about the internal implementation details of a trait (what it calls variables inside of a method) so that it can provide what the trait needs, or a trait needs to be able to carry around its own implementation details. So it seems to me like we can't not let traits carry properties, which means we need to resolve them some how. --Larry Garfield