Java Pub House

Episode 8. What's your Aspect?


Listen Later

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! [email protected]

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

...more
View all episodesView all episodes
Download on the App Store

Java Pub HouseBy Freddy Guime & Bob Paulin

  • 4.8
  • 4.8
  • 4.8
  • 4.8
  • 4.8

4.8

46 ratings


More shows like Java Pub House

View all
Marketplace by Marketplace

Marketplace

8,749 Listeners

WSJ Your Money Briefing by The Wall Street Journal

WSJ Your Money Briefing

1,710 Listeners

DataFramed by DataCamp

DataFramed

268 Listeners

Risky Bulletin by risky.biz

Risky Bulletin

44 Listeners

The Retrievals by Serial Productions & The New York Times

The Retrievals

10,260 Listeners