Aspect-Oriented Programming(AOP) in Spring - Part 1


Aspect-Oriented Programming (AOP) Introduction :
AOP is a new methodology that provides separation of crosscutting concerns by introducing a new unit of modularization—an aspect—that crosscuts other modules. With AOP you implement crosscutting concerns in aspects instead of fusing them in the core modules. An aspect weaver, which is a compiler-like entity, composes the final system by combining the core and crosscutting modules through a process called weaving.

Aspect-Oriented Programming (AOP) complements Object-Oriented Programming (OOP) by providing another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. 

AOP Fundamentals:
  • Aspect-oriented programming (AOP) provides for simplified application of cross-cutting concerns.
    • Transaction management
    • Security
    • Logging
    • Auditing
    • Locking
  • AOP sometimes (partially) achieved via Decorators or Proxies
    • CORBA Portable Interceptors
    • Servlet Filters
  • Aspect : Implementation of a cross-cutting concern. 
  • Spring Advisors or Interceptors
  • Joinpoint : Execution point to target
    • Typically, methods
  • Advice : Action taken at a particular joinpoint.
  • Pointcut : A set of joinpoints specifying where advice should be applied (e.g. Regular expression)
  • Introduction/Mixin - Adding methods or fields to an advised class.
  • Weaving : Assembling aspects into advised objects.


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email