Book description
When Object Oriented programming (OO) first appeared, it was a revelation. OO gave developers the ability to create software that was more flexible and robust, but as time went on and applications became more sophisticated, too, certain areas of "traditional" OO architectures were found wanting. Aspect-oriented programming (AOP) addresses those issues by extending the OO approach even further.Many developers are interested in AOP--especially in AspectJ, the open source extension of the Java programming language that explicitly supports the AOP approach. Yet, although AspectJ is included with Eclipse, the increasingly popular open source IDE for Java, finding a practical and non-theoretical way to learn this language and other AOP tools and techniques has been a real problem.Until now. The AspectJ Cookbook offers a hands-on solution--in fact, several--with a wide variety of code recipes for solving day-to-day design and coding problems using AOP's unique approach.AOP allows the global properties of a program to determine how it's compiled into an executable program. Before AOP, important program design decisions were difficult to capture in actual code. Instead, the implementation of those design decisions--known as "aspects"--were scattered throughout, resulting in "tangled" code that was hard to develop and maintain. AOP has been compared to the manufacturing of cloth, in which threads are automatically interwoven. Without AOP, programmers must stitch the threads by hand.The AspectJ Cookbook shows readers why, and how, common Java development problems can be solved by using AOP techniques. With our popular problem-solution-discussion format, the book presents real world examples to demonstrate that AOP is more than just a concept; it's a development process that will benefit users in an immediate and visible manner.If you're interested in how AOP is changing the way software is developed, and how you can use AspectJ to make code more modular, easier to develop, maintain, evolve and deploy, this is the book that really delivers.
Table of contents
- A Note Regarding Supplemental Files
- Preface
- 1. Aspect Orientation Overview
-
2. Getting Started with AspectJ
- Introduction
- 2.1. Installing AspectJ
- 2.2. Developing a Simple Aspect
- 2.3. Compiling an Aspect and Multiple Java Files
- 2.4. Weaving Aspects into Jars
- 2.5. Weaving Aspects at Load Time
- 2.6. Generating Javadoc Documentation
- 2.7. Compiling an AspectJ Project Using Eclipse
- 2.8. Selecting the Aspects That Are Woven in a Build Within Eclipse
- 2.9. Building an AspectJ Project Using Ant
- 3. Deploying AspectJ Applications
- 4. Capturing Joing Points on Methods
- 5. Capturing Join Points on Exception Handling
- 6. Capturing Join Points on Advice
- 7. Capturing Join Points on Class Object Construction
- 8. Capturing Join Points on Attributes
- 9. Capturing Join Points Within Programmatic Scope
- 10. Capturing Join Points Based on Control Flow
- 11. Capturing Join Points Based on Object Type
-
12. Capturing Join Points Based on a Boolean or Combined Expression
- Introduction
- 12.1. Capturing When a Runtime Condition Evaluates to True on a Join Point
- 12.2. Combining Pointcuts Using a Logical AND (&&)
- 12.3. Combining Pointcuts Using a Logical OR (||)
- 12.4. Capturing All Join Points NOT Specified by a Pointcut Declaration
- 12.5. Declaring Anonymous Pointcuts
- 12.6. Reusing Pointcuts
-
13. Defining Advice
- Introduction
- 13.1. Accessing Class Members
- 13.2. Accessing the Join Point Context
- 13.3. Executing Advice Before a Join Point
- 13.4. Executing Advice Around a Join Point
- 13.5. Executing Advice Unconditionally After a Join Point
- 13.6. Executing Advice Only After a Normal Return from a Join Point
- 13.7. Executing Advice Only After an Exception Has Been Raised in a Join Point
- 13.8. Controlling Advice Precedence
- 13.9. Advising Aspects
- 14. Defining Aspect Instantiation
- 15. Defining Aspect Relationships
- 16. Enhancing Classes and the Compiler
- 17. Implementing Creational Object-Oriented Design Patterns
- 18. Implementing Structural Object-Oriented Design Patterns
-
19. Implementing Behavioral Object-Oriented Design Patterns
- Introduction
- 19.1. Implementing the Observer Pattern
- 19.2. Implementing the Command Pattern
- 19.3. Implementing the Iterator Pattern
- 19.4. Implementing the Mediator Pattern
- 19.5. Implementing the Chain of Responsibility Pattern
- 19.6. Implementing the Memento Pattern
- 19.7. Implementing the Strategy Pattern
- 19.8. Implementing the Visitor Pattern
- 19.9. Implementing the Template Method Pattern
- 19.10. Implementing the State Pattern
- 19.11. Implementing the Interpreter Pattern
- 20. Applying Class and Component Scale Aspects
- 21. Applying Application Scale Aspects
- 22. Applying Enterprise Scale Aspects
- 23. Applying Aspect-Oriented Design Patterns
- A. The AspectJ Runtime API
- Index
- Colophon
- Copyright
Product information
- Title: AspectJ Cookbook
- Author(s):
- Release date: December 2004
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596006549
You might also like
book
Generative Deep Learning, 2nd Edition
Generative AI is the hottest topic in tech. This practical book teaches machine learning engineers and …
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Spring Boot: Up and Running
With over 75 million downloads per month, Spring Boot is the most widely used Java framework …
book
Effective Java, 3rd Edition
Since this Jolt-award winning classic was last updated in 2008, the Java programming environment has changed …