AspectJ in Action, 2nd Edition
Buy it now
One Minute Bottom Line
|If you have never used AOP before and think that AspectJ is just magic-ware, then read this book. It will force you to think about solving complex problems in a different light completely.|
This book covers theory and application of AOP equally well. It kicks off with a great introduction to AOP and dives right into an example using AspectJ. Once you get the basics, Ramnivas does an excellent job of explaining the key components that make up AspectJ - the joinpoint model, the advice and cross cutting model and how these two are combined to create aspects. The coverage of cross cutting is divided into dynamic and static cross cutting and the contextual use of these is nicely described.
The theory side of the book then moves into the @AspectJ annotation and how it is used as an alternative mechanism for creating aspects. The magic-ware flavor of AOP is dispelled once you read the chapter on weaving models which explains clearly the differences and usage of load time weaving and build time weaving.
The final chapter on the theory side is dedicated to the integration of AspectJ into the Spring Framework. It has clear examples on how to combine AOP with a dependency injection container. If you want to explore advanced usage of the Spring Framework, then this chapter is for you.
The second part of the book focuses on applying AspectJ and has more than adequate coverage on the following main use cases.
- Monitoring techniques - the "ubiquitous" tracing and logging example
- Enforcing architectural and design policies
- Patterns for using AspectJ
- Implementing concurrency control
- Managing transactions
- Application security
- The often neglected area of using aspects for implementing domain logic
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)