Using Annotations with Aspects in Pre-Java 5 Versions
If you're interested in combining the power of annotations and aspects but can't yet move to Java 5, don't be discouraged; you still have robust options. Several AOP frameworks provide this capability today.
by Rod Coffin
August 30, 2005
spect oriented programming's (AOP's) rapid rise in popularity inspires both fear and worshipand for good reasonsit's a very powerful software development technique that separates business logic from the infrastructure services that support that logic. In other words, AOP facilitates the centralization of concerns that cut across code boundaries, such as transactions, security, and auditing. Another compelling use of AOP is in leveraging aspects that enforce policies, such as programmatic security checks, rather than simply relying on programmers to adhere to coding standards.
But because AOP is such a powerful tool you must use it carefullyand for the right reasons. Aspects, by their very nature, can alter the behavior of almost any point of execution within your application. Furthermore, because aspects remove cross-cutting concerns from the normal flow of business logic, their insertion into the execution path of your application is invisible when looking at source code. One of the trickiest parts of working with aspects is defining how they should be woven into the flow of your application, a process known as defining a pointcut. Defining pointcuts is challenging because it's difficult to select specific points in the flow of the program (join points) accurately using an expression. For more information about AOP and pointcuts, see the Related Resources in the left column of this article.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!