could AOP programming do such thing ?
a method named listAll() return all records from a database table,
could use AOP programming for limit the return records by visitor's role?
could AOP programming do such thing ?
a method named listAll() return all records from a database table,
could use AOP programming for limit the return records by visitor's role?
Your question is generic - so the answer is 'it depends. For example, you can use an interceptor which simply 'chops off' the result - you listAll would still return all the database fields.
If you want to modify the listAll() method through AOP then it really depends on how the method is implemented. You can do a total rewrite of listAll() (i.e. listAllNew()) and delegate all calls to listAll to listAllNew() for example.
AOP is not a silver bullet - not in every situation at least![]()
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
Please use [ c o d e ] [ / c o d e ] tags