Award-winning Top 25 JUG!

Book Reviews

This book review was submitted by a DenverJUG member as part of the Book Review Program.

BOOK DETAILS

AspectJ in Action: Practical Aspect-Oriented Programming
Author: Ramnivas Laddad
Publisher: Manning Publications Co.
Publish Date: July, 2003
Pages: 512
ISBN: 1930110936
Publisher's Book Description

Review Date: September, 2004
 

REVIEWER

Anshuman Purohit

REVIEW

Summary
It is natural for some people to question the need of AOP, and some to argue the implementation of AOP through language extension [1]. Whether compile-time or "online" weaving is best is debatable [2]. While these debates continues and each implementation learn from other, books like AspectJ in Action invite more developers to experiment with AspectJ in real software development.

AspectJ in Action is a must read for Java developers willing to solve really tough problems in a cleaner and creative way.

Intended Audience
This book is for intermediate to advanced Java users. Thorough understanding of OO concepts, Java and substantial experience in software development is expected. Architect and senior developers do acknowledge the power of AOP and will appreciate the in-depth and practical treatment of the topic in this book.

"High cohesion and low coupling" [3] is the mother of all design patterns. Abstraction is an instrument to it. While OOP/OOD aims to achieve object abstraction, AOP/AOSD strives for concern abstraction. Even with sophisticated object oriented design, either most of the application is overly complex or result in code scattering/entangling when it comes to system-level concern implementation. That's where Aspect Oriented Programming augments to current object oriented systems. AspectJ is an open-source Java extension for AOP. "AspectJ in Action" is a detailed and pragmatic text on AOP and AspectJ together.

Content and Structure
This book shines in both the content and its organization. As content, the books covers AOP paradigm, AspectJ basic and advanced feature/syntax, basic and advanced applications. It also attests to maturity of AspectJ by providing a few Design Patterns. Most of code samples provided in the book and available in the internet are correct and complete. In addition, the author is very responsive to discussion at the book forum and other online forums.

Often late in the project we catch ourselves wishing "If I had done this..." scenario. Architect's dilemma is always to strike a balance between under-design and over-estimate. At the beginning of the project, this balance is just as good as your worst projections and extrapolation. This is where AOP shines in implementing an extensible architecture. This is the first topic of this book. Just after setting the stage, the book addresses some myths about AOP/AspectJ. I found it grippingly interesting. Second chapter, initially, goes through some basic syntactic overview of AspectJ. Later on in this chapter AspectJ compiler, browser and some IDE integration is covered, but details about these topics are there in Appendices. More detailed syntax about static/dynamic crosscutting, pointcuts, advice, and context collection is covered in third chapter. More advanced topics like aspect precedence, aspect association, and privileged aspects are covered in fourth chapter.

Part 1 (chapter 1-4) provides an AspectJ language overview, building the foundation one chapter over another. Today, there is no AspectJ language specification. Author did an excellent job at not letting the reader feel that gap.

Part 2 (chapter 5-7) goes into basic applications of AspectJ in real applications like logging/tracing, policy enforcement and pooling/caching. Like other "in Action" books, here you'll find application code, real experience and advices. Each topic starts with a conventional solution to the problem at hand and then follows with an AspectJ solution. Code and code templates from these topics are very relevant and ready to use. These chapters are problem specific and do not build on each other and hence one can skip the previous chapter if he/she wishes to.

Part 3 (chapter 8-13) discusses some advance topics. Chapter 8, a prerequisite for rest of the chapters discusses about design patters and idioms in AspectJ. I found Wormhole Pattern particularly interesting. Rest of the patterns is either discussed at other places or is just syntactic sugar. However, they form a nomenclature to be used later in the book. Later chapters in Authentication/Authorization using JAAS, Transaction Management and Implementing business rules through JESS are the best. The treatment of the subject matter is very practical and palatable. These hundred pages themselves pay for the price of the book.

The book summarizes the topic on a discussion about how to practice AOP/AOSD in existing software development.