The definitive (and only) introduction to Aspect-Oriented Programming (AOP) using Eclipse and ASpectJ.
° Author team is made up of the lead developers of AspectJ Development Tools(AJDT)
° AOP and AspectJ are rapidly growing and evolving along with Eclipse
° The first book to present a complete package of a productive development environment for AOP
Aspect-oriented software design (ASOD), which follows the Java philosophyof "write once, run anywhere", is a new way of thinking about programconstruction. It is a rapidly growing and evolving programming methodologythat some feel may eventually replace object-orientation as the dominantprogramming paradigm. The first public release of the AspectJ programminglanguage was in 1998 and has been gaining momentum ever since. This book isan introduction to AOP with AspectJ and Eclipse and shows how to create aproductive AO development environment by using the AspectJ DevelopmentTools for Eclipse (AJDT). Tools have an important role to play in learningaspect-orientation (AO) and Eclipse tools help Java developers betterunderstand AOP. In fact the growing interest in AOP can be attributed to thebetter available tools and this book teaches the reader everything they need tounderstand AOP and apply it successfully to their own projects.
This source code file contains the code from Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools by Adrian Colyer, Andy Clement, George Harley and Matthew Webster.
Download the Sample
Chapter related to this title.
I. INTRODUCING ECLIPSE, ASPECTJ, AND AJDT.
1. Getting Started.
What Is Eclipse?
Examples for This Book.
2. First Steps in AJDT.
A Simple Insurance Application.
Tracking Policy Updates.
Creating an AspectJ Project.
Creating the PolicyChangeNotification Aspect.
Stating the Notification Policy.
Implementing the Notification Policy.
Showing Advice In AJDT.
Evaluating the Implementation.
3. Extending the Application.
The Story So Far.
Managing Build Configurations.
4. More AJDT.
Building an ASPECTJ Project.
Editor Templates and the Outline View Toolbar.
Generating Documentation (Ajdoc).
AspectJ Help, Examples, and Cheat Sheets.
II. THE ASPECTJ LANGUAGE.
5. An Overview of AspectJ.
What Is An Aspect?
Join Points and Pointcuts.
Key Design Properties of the AspectJ Language.
6. Straight to the Point.
The Calculator Program.
Introduction to Pointcut Designators.
The Method Call Pointcut Designator.
Patterns and Signatures.
The Method Execution Pointcut Designator.
The Target Pointcut Designator.
The this Pointcut Designator.
The get and set Pointcut Designators.
Capturing Context with the args Pointcut Designator.
Extracting Values with this and target.
The handler Pointcut Designator.
Initialization Pointcut Designators.
Static Scoping Pointcut Designators: within, withincode.
Dynamic Scoping Pointcut Designators: cflow, cflowbelow.
The adviceexecution Pointcut Designator.
The if Pointcut Designator.
How to Write a Good Pointcut.
7. Take My Advice.
The Different Types of Advice.
Advice Parameters and Pointcuts.
Writing Logic in the Body of Advice.
declare warning and declare error.
8. Inter-Type Declarations.
Fields, Methods, and Constructors.
Scope and Visibility.
Inter-Type Declarations and Interfaces.
Using Pointcuts and Advice with Inter-Type Declarations.
Aspect Definition and Initialization.
10. Using the AspectJ API.
III. PUTTING IT ALL TOGETHER.
11. Adopting AspectJ.
The Adoption Process.
Different Types of Aspects.
Enforcement Aspect Examples.
Infrastructure Aspect Examples.
Core Aspect Examples.
Evaluating the Simple Insurance Application.
12. Advanced AJDT.
Linking Aspects with Compiled .class Files.
13. Aspect-Oriented Design.
What Makes a Good Aspect?
Appendix A. Command-Line AspectJ.
Using the Compiler.
Building with Ant.
Appendix B. AspectJ Language Quick Reference.
Appendix C. Next Steps.
Mailing Lists and FAQ.
Raising Bugs and Enhancement Requests.
Contributing to the Development of AspectJ and AJDT
Appendix D. AJDT Icons Reference.