Book description
Now every Java developer can leverage the immense power of AOP With AspectJ, Java developers can leverage the breakthrough power of Aspect-Oriented Programming (AOP) using a language they already know, within the comfortable, highly productive Eclipse development environment. In this book, AspectJ's lead developers help you master AOP's essential principles and techniques, as you use them to address your toughest software quality, productivity, and maintenance challenges.
AOP improves the modularity of programs, making the code much closer to the design. It can dramatically reduce the time taken to implement common features and functions, improve quality, integrate plain-old Java objects with systems and services, create simpler, more reusable components, and much more besides.
Drawing on their experience as tool developers, programmers, and mentors, the authors cover every facet of AOP development with AspectJ and Eclipse, from creating new projects through extending and
documenting full-fledged applications. You'll find an authoritative tutorial covering the entire AspectJ language, a complete API reference, and realistic guidance on adopting AspectJ in your organization.
No AOP or Eclipse experience necessary!
Install and configure both Eclipse and the AspectJ Development Tools (AJDT)
Discover how AOP can modularize and optimize everything from error checking to performance
Craft new AspectJ applications and incorporate AOP capabilities into existing systems
Build, debug, and document AspectJ applications
Understand crucial AOP concepts, such as join points, pointcuts, advice, and inter-type declarations
Master advanced techniques: Aspect libraries, linking with compiled .class files, visualization, aspect-oriented design, and more
The accompanying website, www.awprofessional.com/title/0321245873, is full of samples, examples, and source code to help you start writing Java-based AOP software today.
© Copyright Pearson Education. All rights reserved.
Table of contents
- Copyright
- The Eclipse Series
- Acknowledgments
- About the Authors
- Preface
- Introduction
-
1. Introducing Eclipse, AspectJ, and AJDT
- 1. Getting Started
-
2. First Steps in AJDT
- 2.1. A Simple Insurance Application
- 2.2. Tracking Policy Updates
- 2.3. Creating an AspectJ Project
- 2.4. Creating the PolicyChangeNotification Aspect
- 2.5. Stating the Notification Policy
- 2.6. Implementing the Notification Policy
- 2.7. Showing Advice in AJDT
- 2.8. Evaluating the Implementation
- 2.9. Finishing Touches
- 2.10. Summary
-
3. Extending the Application
- 3.1. The Story So Far
- 3.2. Serialization-Based Persistence
-
3.3. Hibernating
- 3.3.1. Preparing to Use Hibernate
- 3.3.2. Implementing Persistence with Hibernate
- 3.3.3. Creating the HibernateManager Aspect
- 3.3.4. DAO Dependency Injection
- 3.3.5. Meeting Hibernate’s Requirements
- 3.3.6. Initial Hibernate Configuration
- 3.3.7. Mapping Exceptions
- 3.3.8. Implementing the Data Access Objects
- 3.3.9. Evaluating the Implementation
- 3.4. Managing Build Configurations
- 3.5. Summary
- 4. More AJDT
-
2. The AspectJ Language
- 5. An Overview of AspectJ
-
6. Straight to the Point
- 6.1. The Calculator Program
- 6.2. Introduction to Pointcut Designators
- 6.3. The Method Call Pointcut Designator
- 6.4. Pointcut Composition
- 6.5. Patterns and Signatures
- 6.6. The Method Execution Pointcut Designator
- 6.7. The Target Pointcut Designator
- 6.8. The this Pointcut Designator
- 6.9. The get and set Pointcut Designators
- 6.10. Capturing Context with the args Pointcut Designator
- 6.11. Extracting Values with this and target
- 6.12. The handler Pointcut Designator
- 6.13. Initialization Pointcut Designators
- 6.14. Static Scoping Pointcut Designators: within, withincode
- 6.15. Dynamic Scoping Pointcut Designators: cflow, cflowbelow
- 6.16. The adviceexecution Pointcut Designator
- 6.17. The if Pointcut Designator
- 6.18. How to Write a Good Pointcut
- 6.19. Common Pitfalls
- 6.20. Summary
-
7. Take My Advice
- 7.1. The Different Types of Advice
- 7.2. Advice Parameters and Pointcuts
- 7.3. Writing Logic in the Body of Advice
- 7.4. Advice Ordering
- 7.5. Softening Exceptions
- 7.6. declare warning and declare error
-
7.7. Common Pitfalls
- 7.7.1. Only Before Advice at Handler Join Points
- 7.7.2. No get Join Points for Compile-Time Constants
- 7.7.3. No Return Value for Constructor Execution
- 7.7.4. No Return Value for set Join Points
- 7.7.5. After Throwing Advice Does Not Handle Exceptions
- 7.7.6. Restrictions on declare error / warning Pointcut Expressions
- 7.8. Summary
-
References
- 8. Inter-Type Declarations
- 9. Aspects
-
10. Using the AspectJ API
- 10.1. Package org.aspectj.lang
-
10.2. Package org.aspectj.lang.reflect
- 10.2.1. org.aspectj.lang.reflect.SourceLocation
- 10.2.2. org.aspectj.lang.reflect.MemberSignature
- 10.2.3. org.aspectj.lang.reflect.FieldSignature
- 10.2.4. org.aspectj.lang.reflect.CodeSignature
- 10.2.5. org.aspectj.lang.reflect.MethodSignature
- 10.2.6. org.aspectj.lang.reflect.AdviceSignature
- 10.2.7. ConstructorSignature and InitializerSignature
- 10.2.8. org.aspectj.lang.reflect.CatchClauseSignature
- 10.3. Summary
-
3. Putting It All Together
- 11. Adopting AspectJ
- 12. Advanced AJDT
- 13. Aspect-Oriented Design
- A. Command-Line AspectJ
- B. AspectJ Language Quick Reference
- C. Next Steps
- D. AJDT Icons Reference
Product information
- Title: Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools
- Author(s):
- Release date: December 2004
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780321245878
You might also like
book
Tidy First?
Messy code is a nuisance. "Tidying" code, to make it more readable, requires breaking it up …
book
JUnit in Action, Third Edition
JUnit in Action, Third Edition has been completely rewritten for this release. The book is full …
book
Deciphering Data Architectures
Data fabric, data lakehouse, and data mesh have recently appeared as viable alternatives to the modern …
book
Spring Start Here
Quickly master the massive Spring ecosystem with this focused, hands-on guide that teaches you exactly what …