Discover this podcast and so much more

Podcasts are free to enjoy without a subscription. We also offer ebooks, audiobooks, and so much more for just $11.99/month.

Episode 8. What's your Aspect?

Episode 8. What's your Aspect?

FromJava Pub House


Episode 8. What's your Aspect?

FromJava Pub House

ratings:
Length:
36 minutes
Released:
Nov 17, 2011
Format:
Podcast episode

Description

In this episode we go over Aspects (and AspectJ), what really is, and when to use them. It turns out, that there is nothing misterious about them! We also cover how to set-up Aspects for J2SE so you can start using them immediately!
Questions, feedback or comments! comments@javapubhouse.com
VM Parameter -javaagent:dep/aspectjweaver.jar
Example Aspect
@Aspectpublic class OrderAspect { @Before("execution(* *.*(Order))") // must qualify public void anyCall() { System.out.println("Was called from anywhere"); }}
Example aop.xml file

Example Folder Structure
src | |-META-INF | |-aop.xml
References:
http://www.eclipse.org/aspectj/doc/released/adk15notebook/ataspectj-pcadvice.html
http://www.eclipse.org/aspectj/doc/next/quick5.pdf
http://blog.espenberntsen.net/2010/03/20/aspectj-cheat-sheet/
(Using aspects with annotations) http://stackoverflow.com/questions/2011089/aspectj-pointcut-for-all-methods-of-a-class-with-specific-annotation
Released:
Nov 17, 2011
Format:
Podcast episode

Titles in the series (100)

This podcast talks about how to program in Java; not your tipical system.out.println("Hello world"), but more like real issues, such as O/R setups, threading, getting certain components on the screen or troubleshooting tips and tricks in general. The format is as a podcast so that you can subscribe to it, and then take it with you and listen to it on your way to work (or on your way home), and learn a little bit more (or reinforce what you knew) from it.