Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62443 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48510 invoked from network); 24 Aug 2012 06:28:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2012 06:28:51 -0000 Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:60094] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/E2-30159-12F17305 for ; Fri, 24 Aug 2012 02:28:49 -0400 Received: by eaao11 with SMTP id o11so429668eaa.29 for ; Thu, 23 Aug 2012 23:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:x-google-sender-delegation:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=xHAILrcaK/J+//X8V0eMUWmPIq/5yoL90esGpkEyYew=; b=XO446gfNQQxh57VeTyg+8Kdlar3M/6ZODAt6hUg2oCWxlMZLALr1VOl7pomqOZ3OBi gaueg5WKj9mCiIHES+WQC29YptjsRMBKUxGGhS1o1BK12n4/rM0KigORyxhAIKthTObx XIFu4CFhtfSsU0twHk6mUPJnXgFvYsuuZMpDegI8nS0bgyD68nXnPfnE89uQJ+5bVap8 fEWCDrxkqgie24H5UGdtYvJTZV8GtvHMxL5F5zK1+03u+hC1NpD6cR6AsqBd9+HRR2PF +4PZylw/dy1nZ5rms2afl6JHaDwcjMpNHplC6skksi0EqDEb8NmtQQ9AIai17w/e4vsA tABg== MIME-Version: 1.0 Received: by 10.14.203.73 with SMTP id e49mr5879864eeo.27.1345789725247; Thu, 23 Aug 2012 23:28:45 -0700 (PDT) Sender: sebastian.krebs.berlin@gmail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@gmail.com Received: by 10.14.176.73 with HTTP; Thu, 23 Aug 2012 23:28:45 -0700 (PDT) In-Reply-To: References: <50369892.6080106@googlemail.com> Date: Fri, 24 Aug 2012 08:28:45 +0200 X-Google-Sender-Auth: BucOEhOGxO8DhZZo4I87HQuMCjw Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=047d7b343f068407e804c7fd168c Subject: Re: [PHP-DEV] Aspect Oriented Programming in PHP From: krebs.seb@gmail.com (Sebastian Krebs) --047d7b343f068407e804c7fd168c Content-Type: text/plain; charset=ISO-8859-1 2012/8/24 Peter Nguyen > Your argument is a general issue when refactoring code. Whenever you > change the name of a method/class, you need to change it in all the places > that use it, even in the AOP definitions if you have it of course. The > advice is just a PHP callable so it works in the same way. I talked about refactoring the joint points, not the advises, but thats not the point. If I refacter an identifier my IDE (I use PhpStorm, but the others should be that powerful too) supports me by searching for every occurence of the identifier, or even without the need to refactor stuff I can call "find usage". With a string like $ 'Classname::method()' or $ 'Classname->method()' I need at least text search, that should work reliable, when no dynamic strings occur, because with $ 'Classname::' . $method it's getting hard, if not even impossible. One default case (it's mentioned in the quickstart of the extension) are the wildcards $ 'Classname::do*() I guess this would take much effort. Just "refactoring" is not that easy anymore. Don't get me wrong: I like AOP as idea and as concept, but I'm afraid, that it could lead to scary construction, where noone can trace, what happens when and why. Also as I mentioned I don't even have any better idea ;) Regards, Sebastian > > 2012/8/23 Sebastian Krebs > >> Hi, >> >> From my users point of view: I would like to see it. Maybe not in this >> implementation/syntax, especially because it hasn't a special syntax (but >> imo it should to make the impact more obvious/prominent). With the joint >> points as string and the common function call I can imagine it can get hard >> to find out, where a specific advise where attached, or which were attached >> at all, or just how many. For example I rename a method/class and I will >> not recognize, that a security advise gets lost, I may realize it as soon >> as I find my data on pastebin ;) But I have no idea how it could look >> like.... >> >> Regards, >> Sebastian >> >> >> Am 23.08.2012 16:36, schrieb Peter Nguyen: >> >> Hi, >>> >>> AOP (http://en.wikipedia.org/wiki/**Aspect-oriented_programming) >>> when used >>> correctly, can make your application really modular. I've seen several >>> implementations but they all require compiling of code beforehand. There >>> is >>> however a PECL extension now (https://github.com/AOP-PHP/**AOP) >>> that enable >>> AOP in PHP directly. I was wondering if there are any >>> interests/possibility >>> to include AOP into the PHP core? >>> >>> Best regards, >>> >>> Peter >>> >>> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > -- github.com/KingCrunch --047d7b343f068407e804c7fd168c--