This is a practical introduction to aspect-oriented programming (AOP) for Java. Aspect-oriented programming is a relatively new paradigm that complements object-oriented (OO) techniques. Albeit now mature for prime time, from the tools and technology standpoint, AOP acceptance is not yet widespread: lacking major commercial sponsors, the promotion of AOP has been left to the willing. Laddad brings to the professional community a valuable book, to support AOP tutoring and adoption.
The book is divided into three parts: “Understanding AOP and AspectJ,” “Basic Applications of AspectJ,” and “Advanced Applications of AspectJ.” The first part is a tutorial that introduces AOP, and its AspectJ implementation for Java. It addresses and explains the fundamental concepts of AOP, and provides an overview of AspectJ, including syntax and general programming techniques. The second part presents practical examples of how AOP can simplify tasks like logging, tracing, profiling, and simple optimization, and how it can provide tools to enforce coding policies. The third part introduces idiomatic pattern-based AOP techniques, and provides more examples for applying these techniques to problems with a degree of complexity approaching real-life solutions.
This is not groundbreaking work, but it is a solid, well-structured introduction to a recent technology. It is addressed to professional practitioners with an understanding of OO design, who are reasonably proficient in Java, and have some real-life experience under their belts. The book gradually builds an argument in favor of AOP as a new, efficient approach to solving design problems that object orientation only partially untangles. The approach favors solid documentation and practical examples over theoretical claims. The book provides all of the conceptual background needed to understand how to apply, adapt, and modify examples into useful solutions. No prior knowledge of aspect-oriented programming is assumed; Laddad succeeds here in providing both an introductory knowledge of AOP, and information about how to put it to good use.
Perhaps the major fault of this book is its failure to caution against abuse of AOP. A powerful paradigm with effective supporting tools, misapplied AOP can complicate the task of code development and, especially, code maintenance. The need for tight design discipline is a requisite that could have been emphasized, so to speak, in bolder print. Experienced readers will be able to find this warning written between the lines; less critical readers may not be as wise.
In sum, this book is an analytical introduction to AOP. It is also a practical reference for moving into aspect-oriented programming. The style is clear, and the prose is readable. Code snippets are provided throughout the text, in correct measure to illustrate examples and provide clarification, and are welcome rather than burdensome. Altogether, this is a well-constructed, well-balanced book that delivers what it promises.