Aspects and PHP

phpAspects is a project to bring Aspect-oriented programming (AOP) to PHP. If you don’t know much about aspects then to state it very simply aspects is a way to separate concerns such as logging and dependencies like database handling to produce more manageable and maintainable code, but the wikipedia article on aspects can describe this better than I can!

Now this project isn’t really mature at the moment i.e. it’s alpha version 0.10 which means it’s very likely to change alot before it becomes final which is the main reason I’ve decided not to use it from my SimpleStorageService project – although I’m really tempted to play around with it anyway; The other reason why I’m not going to use it is because i’d have to add anotherĀ PECL dependency to the project (on top of PDO) which is Parse_Tree (another alpha dependency… Hmmm!). Then again over the last few days I’ve come to believe if you want to write a REST interface on a LAMP style stack you’re going to need to be able to have server level access to configure Apache to allow PUT & DELETE HTTP verbs (editing httpd.conf), although I’m hoping to find a higher level solution to that problem for easier deployment.

But I do recommend that it’s a project you should keep your eye on as sooner or later you’re going to want to use Aspects to keep your code clean and simple. Once it is a bit more mature I will be using it in some or my more work related projects where I’ll have more control of which extensions are compiled into PHP.