Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Summary 115 4.6 Summary Dynamic crosscutting in AspectJ modifies the behavior of the modules and consists of both pointcut and advice constructs. The advice constructs provide a way to express actions at before, after, or around the desired join points. With context-collecting pointcuts, advice can support static typing that is natural to a Java programmer. The reflection support in AspectJ provides access to the join point's static and dynamic information through a small number of interfaces. You can use this context to tailor the advice based on the actual values (method parameters or return value) being used at runtime. Alternatively, you can use this information in tracing aspects to gain more insight into the system's inner workings. The dynamic and static informa- tion together can produce an enriched log output with a simple tracing aspect. Although dynamic crosscutting forms a major part of support for crosscutting func- tionality, elegant solutions need to modify the static structure of the system. Such sup- port comes in the form of static crosscutting, which we'll explore in the next chapter.