Announcement Announcement Module
No announcement yet.
could AOP programming do such thing ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • could AOP programming do such thing ?

    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?

  • #2
    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