Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47295 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54740 invoked from network); 15 Mar 2010 21:43:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2010 21:43:29 -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.59.243 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 76.96.59.243 qmta13.westchester.pa.mail.comcast.net Received: from [76.96.59.243] ([76.96.59.243:33458] helo=qmta13.westchester.pa.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/F6-34010-00AAE9B4 for ; Mon, 15 Mar 2010 16:43:29 -0500 Received: from omta23.westchester.pa.mail.comcast.net ([76.96.62.74]) by qmta13.westchester.pa.mail.comcast.net with comcast id tPaX1d0021c6gX85DZjTGf; Mon, 15 Mar 2010 21:43:27 +0000 Received: from earth.ufp ([98.220.236.211]) by omta23.westchester.pa.mail.comcast.net with comcast id tZmJ1d0034aLjBW3jZmJqY; Mon, 15 Mar 2010 21:46:18 +0000 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id 6D235D7A51 for ; Mon, 15 Mar 2010 16:43:25 -0500 (CDT) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5DKRNwEaQCFS for ; Mon, 15 Mar 2010 16:43:25 -0500 (CDT) Received: from luna.localnet (unknown [192.168.42.1]) by earth.ufp (Postfix) with ESMTPSA id 52EBAD7A42 for ; Mon, 15 Mar 2010 16:43:25 -0500 (CDT) To: internals@lists.php.net Date: Mon, 15 Mar 2010 16:43:24 -0500 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) References: <416155e11003121750o4b1f8e11j4c9124fdaa34a22d@mail.gmail.com> <201003151414.38346.larry@garfieldtech.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-ID: <201003151643.24381.larry@garfieldtech.com> Subject: Re: [PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - "class underloading" -or- "ancestor overloading" From: larry@garfieldtech.com (Larry Garfield) On Monday 15 March 2010 03:08:28 pm Nate Gordon wrote: > > If there were a syntactic-level support for "wrap this object in this > > class and pass through any method that isn't redefined", a sort of > > sideways extends, > > that would become much simpler. I'm not sure what that would look like, > > though. > > > > Or perhaps this is a good time to revisit the traits proposal from a few > > months back? > > While traits do seem pretty cool, the fundamental problem appears to be > that Framework X doesn't let me do what I want. Unfortunately that is the > side effect of using a framework, it does things for you. I had attempted > to build a system like this in userland code to dynamically replace > classes in my framework, but scrapped it because I could only see ways in > which it would be abused. If someone replaces a class buried in a > framework, that modifies some bit of functionality, which is depended on > by a completely unrelated area of the framework, it could potentially > cause issues that would be very hard to track down. This sounds a lot > like aspect oriented programming in the ability to completely overwrite a > function with userland code. > > I feel like the better solution is to fix the framework to allow the > flexibility to do what you want in a controlled manner, and not bend the > language to fix the framework. I don't mean to say that PHP is problem > free or perfect, but I'm not sure this is the best method to fix the > problem at hand. Certainly true; it's not PHP's job to work around framework flaws. However, if PHP can make it easier to make frameworks that don't have common flaws, that is something it can and IMO should do. Traits wouldn't fix the issue mentioned here, but might allow the framework to be written in a way that doesn't have, or at least ameliorates, these sorts of issues. Or perhaps there's a different approach besides traits that would work better. I dunno. :-) --Larry Garfield