Besides registering and managing transactions, what are some practical AOP applications?

I understand the principles, but itโ€™s not easy for me to see where practical applications are beyond a few. Please enlighten me;)

+6
aop
source share
4 answers

Ask any person for support: registration is not a good AOP application. They don't care which method is called inside the application. They care about the significant actions of the application and need the information to be presented as they understand. To create decent logs, you should consider logging as another user interface for the application and design it accordingly.

It would be more accurate to say that AOP can be used to implement tracing.

And I'm not sure if this is useful for transaction management. I found that a simple OO team purely separates transaction management and business logic.

However, a good question! I found that the arguments for AOP fall into two camps:

  • The binding changes to poorly designed code without having to clean up the bad design.
  • Working with poor development tools, such as in-app tracing, because the environment does not have good support for tracking or debugging.
+3
source share

Both Spring and EJB3 contributors consider AOP useful for declarative transactions.

Security of course.

"AOP In Action" has a great example that shows how to use AOP to apply architectural rules, for example, not invoke a retention level beyond the service level.

Qi4j, the last child of Ricard Oberg's brain, uses AOP for dynamic class modifications. I havenโ€™t fully embraced him yet, but if Ricard nudges him, we will all know someday.

+2
source share

AOP is very useful when you have a large legacy application and you want to change it throughout the application.

I recently used it to split the scope of an http session with an extra cookie (except for the session id). This quickly eased the pain of a poorly written session of related code.

Also check out Glassbox for a very good example of how AOP can help create tools for easy monitoring and performance management.

+1
source share

I just started to learn how I can use AOP. So far, I have used it for dependency injection and implemented an interface to support two-way data binding in some UI code.

0
source share

All Articles