A Real-World Perspective of AOP

 

What is the real deal with AOP? Is it something that you should embrace or ignore? What do you gain with AOP, and what do you risk by adopting it? Let’s address these important questions from a practitioner’s point of view. We’ll start with AOP in the context of the typical hype cycle. This will give us a historical perspective on AOP evolution and indicate what lies ahead. We also look at the landscape, focusing on the current situation and changes since the first edition of this book. While AOP is a more general concept, because our focus is the real world use of it, we’ll focus on AspectJ—its most prominent implementation.

Mapping AOP onto the hype cycle

Every technology goes through a cycle that’s well illustrated by the Gartner Hype Cycle (http://en.wikipedia.org/wiki/Hype_cycle). AOP is no exception. Understanding the hype cycle and the position of the technology you’re considering adopting is important. It allows you to offer a more accurate gauge of the benefits the technology is likely to offer and the risk you expose yourself to. In this section, I’ll give my assessment of the hype cycle of AOP in five major phases: technology trigger, peak of inflated expectations, trough of disillusionment, slope of enlightenment, and plateau of productivity. The following figure depicts the hype cycle and how AOP maps to it.

Hype cycle for AOP. After passing through various stages, currently AOP is on the slope of enlightenment. (Hype not to scale!)

Where is AOP being used?

Part 1. Understanding AOP and AspectJ

Chapter 1. Discovering AOP

1.1. Life without AOP

1.2. Modularizing with AOP

1.3. Anatomy of an AOP language

1.4. Fundamental concepts in AOP

1.5. AOP by analogy

1.6. Implementations of AOP

1.7. Alternatives to AOP

1.8. Costs and benefits of AOP

1.9. Summary

Chapter 2. Introducing AspectJ

2.1. Writing your first AspectJ program

2.2. AspectJ crosscutting construct

2.3. AspectJ alternative syntax

2.4. Weaving mechanisms

2.5. AspectJ weaving: under the hood

2.6. Spring AspectJ integration

2.7. AspectJ logistics overview

2.8. Summary

Chapter 3. Understanding the join point model

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

Chapter 4. Modifying behavior with dynamic crosscutting

4.1. Advice overview

4.2. Comparing advice to methods

4.3. Advice in depth

4.4. Collecting join point context

4.5. Accessing join point context via reflection

4.6. Summary

Chapter 5. Modifying structure with static crosscutting