Welcome Guest, Not a member yet? Register   Sign In
AOP & Pointcuts
#1

I am asking this question of the general community to get a feel if anyone would be interested in this feature.

I came from a background of Java-Spring-AOP.  One specific feature I would see as a great addition to the framework would be the implementation of Pointcuts.

http://en.wikipedia.org/wiki/Pointcut

I would like to get comments on how this could be done and the best way to to it.  I have read over this article on how someone implemented it in CI (http://www.sitepoint.com/explore-aspect-...igniter-1/).  But would like to pose that we do something like this more permanent. 

Is hooks the best way to do this?  Is there a better way?  It is worth suggesting this to be put into core at some point?

Does any other PHP framework have this?

I personally will implement this in my own projects soon but wanted to try and do something that would benefit CI in general.

Thanks
Reply
#2

If you are familiar with Spring framework then there is a PHP version of it: Go! AOP framework . It's a standalone AOP implementation for PHP with rich pointcut grammar and fastest load-time weaving.

Available at GitHub at https://github.com/lisachenko/go-aop-php
Reply
#3

If you are used to Spring I think you would be better served with a more enterprisey framework. This sort of behaviour can be achieved with Laravel/Symfony's route filters (blocks to run before and and after a controller method) and event system (pub / sub)
Reply
#4

(This post was last modified: 12-26-2014, 03:54 PM by rfulcher.)

(12-21-2014, 05:13 AM)maxbrokman Wrote: If you are used to Spring I think you would be better served with a more enterprisey framework. This sort of behaviour can be achieved with Laravel/Symfony's route filters (blocks to run before and and after a controller method) and event system (pub / sub)

I understand what you are saying.  I am using Codeigniter specifically because I don't like the overhead of Spring and the required environment on the server.  I still do work in Spring for clients and prefer codeigniter much more (pure personal preference) . Also I have a large application that I have in Codeigniter that I will not be migrating so I want to add this feature to it. I did notice that Laravel could do it so I really hope they would like to put it into CI as well.
Reply
#5

(12-19-2014, 02:00 AM)NightTiger Wrote: If you are familiar with Spring framework then there is a PHP version of it: Go! AOP framework . It's a standalone AOP implementation for PHP with rich pointcut grammar and fastest load-time weaving.

Available at GitHub at https://github.com/lisachenko/go-aop-php

I did see that.  I don't want to switch from CI since I have a large application built in it.  Can Go! AOP integrate or can the methodology apply to CI?
Reply
#6

AOP is not so common in php, so i think there is not used to often. There was an article on sitepoint with 3 parts. I think this will give you a good starting point for your project:

http://www.sitepoint.com/explore-aspect-...igniter-1/

And there are libraries arround the web for aop that you can use with ci as thierd party

http://exarphp.com
https://github.com/AOP-PHP/AOP
https://code.google.com/p/php-aop/

Reply
#7

AOP sounds interesting, but definitely more enterprise-y.

It might be possible to implement using CI, but I get the impression that 80% of the functionality could be handled through hooks or some sort of event mechanism.

Why not write up an RFC addressing how you would see something like that working inside CI?
James Parry
Project Lead
Reply




Theme © iAndrew 2016 - Forum software by © MyBB