View Review Details


Book:   AspectJ Cookbook
Subject:   Another win for the cookbook series
Date:   2007-08-01 16:39:18
From:   Mike
Rating:  StarStarStarStarStar

If you've ever read a book from O'Reilly's Cookbook series, you'll know what to expect from the AspectJ Cookbook. You start by writing your first simple aspect on page 9, and the remainder of the book is examples based on a defined problem/task. Each solution is carefully explained, and most examples build on the examples before it.


The most interesting chapters to me were the ones on design patterns. "Recipes" are provided for implementing many traditional OO design patterns, as well as for implementing aspect-oriented design patterns. Though not a design pattern book, the sample AspectJ implementations are informative and interesting, and a notable number of chapters deal with OO patterns.


This book includes a short reference to the AspectJ API, though if you want a detailed reference to the language, a Cookbook might not be right for you. Presenting examples that build on what the reader learned in previous examples is an excellent way to teach if the reader is going through the book page-by-page; however, using "recipes" as a reference will require either an existing AspectJ familiarity or a detailed read of the first 10 chapters. This is not a criticism; the book is simply not designed to be a reference.


It is also not intended to address the concept of Aspect-oriented programming (AOP), at least not at an abstract level. It is all implementation, all the time; learning about AOP (through design patterns and the like) happens implicitly throughout the book but is never specifically addressed. Identifying concerns and cross-cutting concerns, AOP vs OOP and when to use them, and other higher-level concepts are not addressed. AOP is introduced in the first few pages using AspectJ-influenced language. This is not a weakness; it is simply something to be aware of.


My one actual complaint is that we hit chapter 16 before we learn that AspectJ can be used for more than just join points, that it can also modify/extend existing classes without changing the source for that class.


Overall, if you want to learn how to use AspectJ in real-life, for anything from pattern implementation to enterprise-level development, this book is for you.


See larger cover
Browse within this book