Book description
To allow the creation of truly modular software, OOP has evolved into aspect-oriented programming. AspectJ is a mature AOP implementation for Java, now integrated with Spring.
AspectJ in Action, Second Edition is a fully updated, major revision of Ramnivas Laddad's best-selling first edition. It's a hands-on guide for Java developers. After introducing the core principles of AOP, it shows you how to create reusable solutions using AspectJ 6 and Spring 3. You'll master key features including annotation-based syntax, load-time weaver, annotation-based crosscutting, and Spring-AspectJ integration. Building on familiar technologies such as JDBC, Hibernate, JPA, Spring Security, Spring MVC, and Swing, you'll apply AOP to common problems encountered in enterprise applications.
This book requires no previous experience in AOP and AspectJ, but it assumes you're familiar with OOP, Java, and the basics of Spring.
About the Technology
About the Book
AspectJ in Action, Second Edition is a fully updated, major revision of Ramnivas Laddad's best-selling first edition. It's a hands-on guide for Java developers. After introducing the core principles of AOP, it shows you how to create reusable solutions using AspectJ 6 and Spring 3. You'll master key features including annotation-based syntax, load-time weaver, annotation-based crosscutting, and Spring-AspectJ integration. Building on familiar technologies such as JDBC, Hibernate, JPA, Spring Security, Spring MVC, and Swing, you'll apply AOP to common problems encountered in enterprise applications.
What's Inside
- Totally revised Second Edition
- When and how to apply AOP
- Master patterns and best practices
- Code you can reuse in real-world applications
About the Reader
This book requires no previous experience in AOP and AspectJ, but it assumes you're familiar with OOP, Java, and the basics of Spring.
About the Author
An expert in enterprise Java, Ramnivas Laddad is well known in the area of AOP and Spring. He is a committer on the Spring Framework project.
Quotes
Clear, concisely worded, well-organized... a pleasure to read.
- Rod Johnson, Creator of the Spring Framework
Ramnivas showcases how to get the best out of AspectJ and Spring.
- Andy Clement, AspectJ Project Lead
One of the best Java books in years.
- Andrew Rhine, eSecLending
By far the best reference for Spring AOP and AspectJ.
- Paul Benedict, Argus Health Systems
Ramnivas expertly demystifies the awesome power of aspect-oriented programming.
- Craig Walls, author of Spring in Action
Table of contents
- Praise for the First Edition
- More Praise for the First Edition
- Copyright
- Foreword
- Preface
- Preface to the first edition
- Acknowledgments
- About this book
- About the title
- About the cover illustration
- A real-world perspective of AOP
-
1. Understanding AOP and AspectJ
- 1. Discovering AOP
- 2. Introducing AspectJ
-
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
- 4. Modifying behavior with dynamic crosscutting
- 5. Modifying structure with static crosscutting
-
6. Aspects: putting it all together
-
6.1. Working with aspects
-
6.1.1. Similarities between aspects and classes
- 6.1.1.1. ASPECTS CAN INCLUDE DATA MEMBERS AND METHODS
- 6.1.1.2. ASPECTS CAN HAVE ACCESS SPECIFICATIONS
- 6.1.1.3. ASPECTS CAN BE ABSTRACT
- 6.1.1.4. ASPECTS CAN EXTEND CLASSES AND ABSTRACT ASPECTS, AS WELL AS IMPLEMENT INTERFACES
- 6.1.1.5. ASPECTS CAN BE EMBEDDED IN CLASSES AND INTERFACES AS NESTED ASPECTS
- 6.1.2. Differences between aspects and classes
-
6.1.1. Similarities between aspects and classes
-
6.2. Aspect association
- 6.2.1. Default singleton association
- 6.2.2. Per-object association
- 6.2.3. Per-control-flow association
- 6.2.4. Per-type association
- 6.2.5. Implicit limiting of join points with aspect associations
- 6.2.6. Accessing aspect instances
- 6.2.7. Comparing per-object association and member introduction
- 6.2.8. Improving the caching aspect
- 6.3. Aspect precedence
- 6.4. Privileged aspects
- 6.5. Summary
-
6.1. Working with aspects
-
7. Diving into the @AspectJ syntax
- 7.1. Syntax overview
- 7.2. Mapping aspects
- 7.3. Mapping pointcuts
- 7.4. Mapping dynamic crosscutting constructs
- 7.5. Mapping static crosscutting
- 7.6. Features not implemented in @AspectJ
- 7.7. Comparing syntax styles
- 7.8. Summary
- 8. AspectJ weaving models
- 9. Integration with Spring
-
2. Applications of AspectJ with Spring
-
10. Monitoring techniques
- 10.1. Tracing in action
- 10.2. Conventional vs. AOP tracing
- 10.3. Selecting join points of interest
- 10.4. Tracing
- 10.5. A detour: deployment options for monitoring aspects
- 10.6. Exception monitoring
- 10.7. Improving conventional logging
- 10.8. Performance monitoring
- 10.9. Runtime control of monitoring aspects
- 10.10. Summary
-
11. Policy enforcement: keeping your design intact
- 11.1. AOP-based policy enforcement overview
- 11.2. Policy origins and destinations
- 11.3. Enforcement using AOP
- 11.4. Comparison with code-analysis tools
- 11.5. Implementing flexible access control
- 11.6. Enforcement idiom: return-value restriction
- 11.7. Enforcing JPA-JDBC integration policies
- 11.8. Implementing EJB policies
- 11.9. Detecting Swing concurrency control policy violations
- 11.10. Summary
-
12. Learning design patterns
- 12.1. The worker object pattern
- 12.2. The wormhole pattern
- 12.3. The participant pattern
- 12.4. Annotation-driven participant pattern
- 12.5. Summary
- 13. Implementing concurrency control
- 14. Managing transactions
-
15. Securing applications
- 15.1. Securing applications with conventional techniques
- 15.2. Modularizing security using AOP
- 15.3. A quick overview of Spring Security
- 15.4. Implementing a security solution from scratch
- 15.5. Implementing field-level authorization
- 15.6. Spring Security prebuilt solutions
- 15.7. Additional ideas in implementing security
- 15.8. Summary
- 16. Improving domain logic
- 17. Taking the next step
-
10. Monitoring techniques
- A. Setting up the example
- B. Using Ant with AspectJ
- C. Using Maven with AspectJ
Product information
- Title: AspectJ in Action, Second Edition
- Author(s):
- Release date: August 2009
- Publisher(s): Manning Publications
- ISBN: 9781933988054
You might also like
book
Java Persistence with Hibernate, Second Edition
Java Persistence with Hibernate, Second Edition explores Hibernate by developing an application that ties together hundreds …
book
AspectJ Cookbook
When Object Oriented programming (OO) first appeared, it was a revelation. OO gave developers the ability …
book
The Joy of Clojure, Second Edition
The Joy of Clojure, Second Edition is a deep look at the Clojure language. Fully updated …
book
Java EE 8 Design Patterns and Best Practices
Get the deep insights you need to master efficient architectural design considerations and solve common design …