Chapter 16. Improving domain logic

This chapter covers

  • Empowering objects using DI

  • Implementing crosscutting business logic

  • Avoiding unnecessary DTOs

So far in this book, we've established that AOP is useful for implementing crosscutting infrastructure functionality such as monitoring, concurrency control, transaction management, and security. Those crosscutting concerns are often the first you'll implement with AOP. But AOP is also useful in improving the implementation of domain logic in several ways. First, aspects help in implementing dependency injection (DI) for objects not explicitly managed by a DI container. This enables the implementation of complex behavior that would otherwise be tedious. Second, by modularizing crosscutting business logic, ...

Get AspectJ in Action now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.