Advertisement

Pro Spring pp 161-239 | Cite as

Introducing Spring AOP

  • Chris Schaefer
  • Clarence Ho
  • Rob Harrop
Chapter

Abstract

Besides Dependency Injection (DI), another core feature that the Spring Framework offers is support for aspect-oriented programming (AOP. AOP is often referred to as a tool for implementing crosscutting concerns. The term crosscutting concerns refers to logic in an application that cannot be decomposed from the rest of the application and may result in code duplication and tight coupling. By using AOP for modularizing individual pieces of logic, known as concerns, you can apply these to many parts of an application without duplicating the code or creating hard dependencies. Logging and security are typical examples of crosscutting concerns that are present in many applications. Consider an application that logs the start and end of every method for debugging purposes. You will probably refactor the logging code into a special class, but you still have to call methods on that class twice per method in your application in order to perform the logging. Using AOP, you can simply specify that you want the methods on your logging class to be invoked before and after each method call in your application.

Keywords

Unify Modeling Language Target Object Static Check Method Invocation Advice Type 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Chris Schaefer 2014

Authors and Affiliations

  • Chris Schaefer
    • 1
  • Clarence Ho
    • 1
  • Rob Harrop
    • 1
  1. 1.FLUnited States

Personalised recommendations