Chapter 3. Understanding the join point model

This chapter covers

  • The join point model
  • Pointcut details

The join point model is the central concept in AOP, as you’ve seen in previous chapters. It consists of two parts: join points, the points in the execution of an application; and pointcuts, a mechanism for selecting join points.

AspectJ’s pointcut language is sophisticated, expressive, and elegant. It lets you select join points based on structural information such as types, names, arguments, and annotations as well as runtime conditions such as control flow. This allows you to select exactly the join points you need to implement a crosscutting functionality.

In this chapter, you’ll learn about the concept of a join point in AOP and discuss the join point model in AspectJ. We’ll discuss the join points supported by AspectJ, categorize them, and examine code associated with each kind of join point. Then, you’ll build a simple example to reinforce the concepts learned. We’ll spend the rest of the chapter discussing pointcuts supported by AspectJ along with many code snippets. We’ll also examine various signature patterns that form the basic building blocks of a pointcut.

The Spring Framework supports a subset of AspectJ pointcuts in its proxy-based AOP framework. I’ll provide brief notes about this where appropriate.

3.1. Understanding the join point model

3.2. Categorizing exposed join points

3.3. Join point demonstration example

3.4. Understanding pointcut basics

3.5. Signature syntax

3.6. Implementing pointcuts

3.7. Summary