Chapter 6. Aspects: putting it all together

 

This chapter covers

  • Formally introducing aspects
  • Creating reusable aspects with aspect association
  • Using aspect precedence to coordinate multiple aspects
  • Bypassing access-specification rules using privileged aspects

Aspects represent the unit of modularization in AOP and AspectJ. They provide a way to include crosscutting constructs such as pointcuts and advice. You’ve already seen quite a few aspects in the preceding chapters’ examples.

In this chapter, we’ll take a closer look at the core aspect construct. We’ll begin by examining the aspect construct in a formal way and compare it to the class—the most similar concept in object-oriented programming. Next, we’ll examine the aspect association that provides a mechanism needed to write reusable aspects. We’ll follow that by considering the effects of multiple aspects in a system advising the same join point, and ways to control ordering. We’ll complete this chapter by examining a way aspects can override the standard access-specification rules.

Like the preceding three chapters, we’ll focus on aspects expressed using the traditional syntax. As you’ll see in the next chapter, the concepts you learn here can be easily mapped into aspects expressed using the @AspectJ syntax as well as Spring AOP.

6.1. Working with aspects

 
 

6.2. Aspect association

 
 

6.3. Aspect precedence

 
 
 
 

6.4. Privileged aspects

 
 

6.5. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest