Saturday, August 22, 2009

ASPECT ORIENTED PROGRAMMING

Try the New Tech.....:
AOP is a new technology for separating crosscutting concerns into single units called aspects. An aspect is a modular unit of crosscutting implementation. It encapsulates behaviors that affect multiple classes into reusable modules. With AOP. we start by implementing our project using our OO language (for example, Java), and then we deal separately with crosscutting concerns in our code by implementing aspects. Finally, both the code and aspects are combined into a final executable form using an aspect weaver. As a result, a single aspect can contribute to the implementation of a number of methods, modules, or objects, increasing both reusability and maintainability of the code.



The code that is executed when aspect is invoked is called Advice. It contains own set of rules as to when it is to be invoked in the relation to join points. Join points are simply specific point within the application that may or may not call the advice. Pointcuts are encapsulates the decision making logic that is evaluated to decide if particular piece of advice got invoked when joint is encountered.

Output:
before calling method 1
Inside method
Note:
In Example,
Red
: Joinpoint
Pink: Advice
Green: pointcut

Thanks
A.T.J

No comments:

Post a Comment