[BooK] Aspectj Cookbook.pdf


Aperçu du fichier PDF book-aspectj-cookbook.pdf

Page 1...3 4 567364




Aperçu texte


Introduction ................................................................................................................................ 195
Recipe 15.1. Inheriting Pointcut Definitions .............................................................................. 196
Recipe 15.2. Implementing Abstract Pointcuts .......................................................................... 198
Recipe 15.3. Inheriting Classes into Aspects.............................................................................. 200
Recipe 15.4. Declaring Aspects Inside Classes .......................................................................... 202
Chapter 16. Enhancing Classes and the Compiler .......................................................................... 204
Introduction ................................................................................................................................ 205
Recipe 16.1. Extending an Existing Class .................................................................................. 206
Recipe 16.2. Declaring Inheritance Between Classes................................................................. 207
Recipe 16.3. Implementing Interfaces Using Aspects................................................................ 208
Recipe 16.4. Declaring a Default Interface Implementation ...................................................... 210
Recipe 16.5. Softening Exceptions............................................................................................. 212
Recipe 16.6. Extending Compilation.......................................................................................... 214
Chapter 17. Implementing Creational Object-Oriented Design Patterns........................................ 215
Introduction ................................................................................................................................ 216
Recipe 17.1. Implementing the Singleton Pattern ...................................................................... 217
Recipe 17.2. Implementing the Prototype Pattern ...................................................................... 221
Recipe 17.3. Implementing the Abstract Factory Pattern........................................................... 224
Recipe 17.4. Implementing the Factory Method Pattern ............................................................ 226
Recipe 17.5. Implementing the Builder Pattern.......................................................................... 227
Chapter 18. Implementing Structural Object-Oriented Design Patterns......................................... 229
Introduction ................................................................................................................................ 230
Recipe 18.1. Implementing the Composite Pattern .................................................................... 231
Recipe 18.2. Implementing the Flyweight Pattern ..................................................................... 235
Recipe 18.3. Implementing the Adapter Pattern......................................................................... 238
Recipe 18.4. Implementing the Bridge Pattern........................................................................... 240
Recipe 18.5. Implementing the Decorator Pattern...................................................................... 243
Recipe 18.6. Implementing the Proxy Pattern ............................................................................ 246
Chapter 19. Implementing Behavioral Object-Oriented Design Patterns ....................................... 250
Introduction ................................................................................................................................ 251
Recipe 19.1. Implementing the Observer Pattern ....................................................................... 252
Recipe 19.2. Implementing the Command Pattern ..................................................................... 256
Recipe 19.3. Implementing the Iterator Pattern.......................................................................... 261
Recipe 19.4. Implementing the Mediator Pattern....................................................................... 264
Recipe 19.5. Implementing the Chain of Responsibility Pattern................................................ 267
Recipe 19.6. Implementing the Memento Pattern ...................................................................... 271
Recipe 19.7. Implementing the Strategy Pattern ........................................................................ 274
Recipe 19.8. Implementing the Visitor Pattern........................................................................... 277
Recipe 19.9. Implementing the Template Method Pattern ......................................................... 281
Recipe 19.10. Implementing the State Pattern............................................................................ 283
Recipe 19.11. Implementing the Interpreter Pattern................................................................... 285
Chapter 20. Applying Class and Component Scale Aspects........................................................... 286
Introduction ................................................................................................................................ 287
Recipe 20.1. Validating Parameters Passed to a Method ........................................................... 288
Recipe 20.2. Overriding the Class Instantiated on a Call to a Constructor ................................ 292
Recipe 20.3. Adding Persistence to a Class................................................................................ 295
Recipe 20.4. Applying Mock Components to Support Unit Testing.......................................... 299
Chapter 21. Applying Application Scale Aspects........................................................................... 302
Introduction ................................................................................................................................ 303
Recipe 21.1. Applying Aspect-Oriented Tracing ....................................................................... 304
Recipe 21.2. Applying Aspect-Oriented Logging ...................................................................... 307
Recipe 21.3. Applying Lazy Loading......................................................................................... 311
Recipe 21.4. Managing Application Properties .......................................................................... 316
Chapter 22. Applying Enterprise Scale Aspects ............................................................................. 321
Introduction ................................................................................................................................ 322