News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Imagine Easy:
Pushing the limits of metaprogramming in PHP aspect oriented design
February 20, 2014 @ 12:01:05

In a new post to the "imagine easy" blog Yitzchak Schaffer looks at Aspect Oriented Programming in PHP and pushing the limits of some of the work already done in the area.

Here's the premise [of Aspect Oriented Programming]. A given piece of code exists for a certain purpose - let's say, to retrieve a record from a database. But there may be any number of other things that need to happen in addition to the actual retrieval: logging, access control, caching… those are known as cross-cutting concerns - issues that are relevant across the codebase, but are not specifically relevant to any one piece of code where they might be needed. And being that these bits of functionality are not intrinsically connected with data retrieval, in our example, it would make sense for them to be disconnected from the retrieval implementation.

He includes some example code showing the migration from a typical logging example, moving the logging code away from the other parts and into an "aspect". He briefly mentions some caching functionality and talks about how one PHP framework, Lithium, makes use of these kinds of AOP principles. He offers an alternative in the form of subtypes, and example of which he's implemented in a tool of his own, Camphor.

0 comments voice your opinion now!
aop aspectoriented design metaprogramming example introduction

Link: http://dev.imagineeasy.com/post/77176594791/pushing-the-limits-of-metaprogramming-in-php-aspect

blog comments powered by Disqus

Similar Posts

Jani Hartikainen's Blog: Closures coming in PHP 5.3 and that’s a Good Thing

PHPBuilder.com: Meet PRADO, the Component-based PHP Development Framework

Developer Tutorials: Drupal CMS e-Commerce Module Basics

Web & PHP Magazine: Issue #8 - The Power of Design

PHPBuilder.com: Tracking User Activity in PHP with Cookies and Sessions


Community Events





Don't see your event here?
Let us know!


conference series opinion introduction symfony list framework composer unittest laravel configure voicesoftheelephpant language api version podcast community release interview threedevsandamaybe

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework