Chapter 4. Modifying behavior with dynamic crosscutting

This chapter covers

  • Learning advice basics

  • Using three advice types

  • Writing a caching example

In the previous chapter, we presented the join point model and examined the pointcut construct as the way to select join points of interest. In this chapter, you'll put that knowledge to practical use as we discuss dynamic crosscutting. Dynamic crosscutting constructs provide a way to affect the behavior of a system, whereby you can alter behavior at join points selected by pointcuts. After reading this chapter, you should be able to start writing meaningful programs in AspectJ.

As we discussed in chapter 2, AspectJ supports multiple syntaxes: traditional and @AspectJ. Although the details vary a bit, ...

Get AspectJ in Action now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.