Skip to main content

Posts tagged with 'Java'

Some AOP books

March 21, 2012 mgroves 0 Comments
Tags: AspectJ csharp books Java

As far as AOP goes, there's not a great selection of books out there. I've only found 3 that might be worth reading (I haven't read any of them yet):

  • AspectJ Cookbook by Russ Miles, published by O'Reilly in December 2004. From the reviews, this seems to be a "how" book, and very specific to AspectJ.
  • AspectJ in Action by Ramnivas Laddad, published by Manning in July 2003, second edition in October 2009. This may be the most popular book on AOP, even though it's focused on AspectJ.
  • Using Aspect-Oriented Programming for Trustworthy Software Development by Vladomir O. Safonov, published by Wiley in May 2008. I only discovered this one recently. The author of this book is also the creator of Aspect.NET, but apparently it mentions other AOP tools as well. The price tag is a little steep, and since it was written by a professor, I'm guessing it will be very academic and dry.

That's pretty much it. Two books for Java developers from the mid 2000s, and one book for .NET developers from 2008. Am I leaving anything out? I know other books touch on AOP (like Clean Code by Robert C. Martin, which I highly recommend), but not many that really dive deeply into it.

JavaScript is an object-oriented programming language. (This may be an overly simplistic statement). As an object oriented programming language, it's subject to some of the same pitfalls that other object-oriented languages have, in terms of boilerplate, cross-cutting concerns, etc. With that in mind, AOP is a tool that can be used to address these issues in the JavaScript portion of your application.

For instance, the Prototype JS framework has a wrap function that you can use to implement "the essence of AOP".

Here's a self-contained Hello World example:

A trivial example, but notice that JavaScript's dynamic/functional paradigm gives you the ability to "wrap" a function instead of actually "weaving" in a cross-cutting concern. In this example, prototype's capitalize function is being replaced, which is very similar to an interception aspect, and the underlying capitalize method is being called within that interceptor/wrapper.

Matthew D. Groves

About the Author

Matthew D. Groves lives in Central Ohio. He works remotely, loves to code, and is a Microsoft MVP.

Latest Comments

Twitter