I have read the documents in the following locations. Maybe I'm too dumb but I can't see too many useful examples that I can visualize and no much stay in my mind.
http://eclipse.org/aspectj
http://www.ibm.com/developerworks/java/library/j-aopwork8/index.html
Does anyone have any good and simple AspectJ getting start doc online? An eclipse project sample that I can run and play around with would be super!
AspectJ Provides a Standard Mechanism to Handle a Crosscutting Concern. In the example shown above, we are doing a null validation and throwing an IllegalArgumentException when the request is null. This way we make sure that whenever an argument is null, we get the same uniform behavior.
A study done showed that the AspectJ compiler ajc is about 34% slower than the Sun Microsystems Java 1.3 compiler and about 62% slower than the Java 1.4 compiler.
In this article, we'll look at answering these questions and introduce Spring AOP and AspectJ – the two most popular AOP frameworks for Java.
I have written an example that shows you how AspectJ can work with annotations like @javax.inject.Inject
here
I have also tried to simplify AspectJ with a cheat sheet here.
If you need to understand the theory, the AspectJ in Action is very good. For online resources, the Spring framework has a good reference document you can read here.
I hope it helps!
AspectJ In Action might help. It's got some unusual use cases that will help to get you beyond the logging "hello world" stage.
You can also get your feet wet with real usage by starting with Spring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With