concept ADPP in category aspectj

appears as: ADPP, ADPP
AspectJ in Action, Second Edition

This is an excerpt from Manning's book AspectJ in Action, Second Edition.

The core concept in the participant pattern is explicit participation by the participants (classes, typically). With the growing popularity of language support for metadata, there is a variation of the classical participant pattern: the annotation-driven participant pattern (ADPP). The key to annotation-driven participation is changing how the participants show interest in the functionality offered by an aspect. Whereas the classical version of the pattern uses a pointcut, the ADPP uses one or more annotation types and expects the participants to attach the annotations to appropriate elements. Figure 12.3 shows the general arrangement implemented in ADPP.

Figure 12.4. Bridged participation pattern, where the aspect advises join points based on the associated annotations just as in ADPP. But instead of marking program elements with annotations, additional aspects attach annotations to those elements through declare statements.

12.4.5. Role of ADPP in library aspects

ADPP provides tremendous benefits in writing library aspects by simplifying the collaboration needed by the library users. The aspects in the library often use the bridged participation pattern discussed in the previous section. Instead of writing subaspects and pointcuts (which can be a daunting task for programmers not yet experienced with AOP), library users mark program elements with annotations to participate in the collaboration. Our use of the @Cachable annotation in chapter 4 fits this purpose of creating a reusable solution.