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

Community News: phpAspect Project Revived

WebReference.com: XML and PHP Simplified - XML,PHP and the Database

Symfony Blog: New in symfony 1.2: Doctrine goodies

PHP Thinktank Blog: PHP-GTK with scottmattocks (IRC Talk Series)

Willliam Candillon's Blog: phpAspect on Tour


Community Events

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


community api framework symfony yii2 introduction part2 composer series laravel conference example opinion php7 interview list project language application podcast

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