Frameworks

Episode 15. Java Swing and Performance. It’s not slow!

Taking the performance theme, we move into the dark corners of Java Swing and discover that it is not a lame horse at all! Swing is very fast (with support for directX and OpenGL!), but sometimes is hard to get it to perform right. In this podcast we talk about how to make sure of respecting the EDT, offloading from the EDT, we explain how the EventQueue works, and show THE technique for fast GUI performance. If you know what Swing is, tune in! We will dispell Swing’s performance myths!

Using Aspects to debug Swing Apps (http://weblogs.java.net/blog/alexfromsun/archive/2006/02/debugging_swing.html)
Java Flags for DirectX and OpenGL (http://docs.oracle.com/javase/1.5.0/docs/guide/2d/flags.html)
InvokeLater, InvokeAndWait (http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html)

Questions, feedback or comments!comments@javapubhouse.com

Subscribe to our podcast! (http://javapubhouse.libsyn.com/rss)
ITunes link (http://itunes.apple.com/us/podcast/java-pub-house/id467641329)
Java 7 Recipes book! (http://www.amazon.com/Java-7-Recipes-Problem-Solution-Approach/dp/1430240563)

Episode 10. Testing, Testing, 1.2.3! (All about Unit Testing, And Dependency Injection)

For those Unit Testers out there (and those who want to do more unit tests), this podcast is for you! We cover JUnit in general, and explain how to shoe-in unit tests in current (and legacy code). We talked about Dependency Injection (and the Concern of Creation), and Mocking (what it is, and how is it used). In all, if you ever wondered why creating unit tests in your current code is hard, or why are people talking about Dependency Injection (DI), come in, and listen!

Questions, feedback or comments!comments@javapubhouse.com

Subscribe to our podcast! (http://javapubhouse.libsyn.com/rss)
ITunes link (http://itunes.apple.com/us/podcast/java-pub-house/id467641329)
Java 7 Recipes book! (http://www.amazon.com/Java-7-Recipes-Problem-Solution-Approach/dp/1430240563)

 

Episode 8. What’s your Aspect?

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

@Aspect

public class OrderAspect {

    @Before("execution(* *.*(Order))") // must qualify
    public void anyCall() {
        System.out.println("Was called from anywhere");
    }
  }

Example aop.xml file

          <aspectj>
            <aspects>
              <aspect name="OrderAspect"/>
            </aspects>
            <weaver options="-verbose -showWeaveInfo">
            </weaver>
          </aspectj>

Example Folder Structure

src
 |
 |-META-INF
    |
    |-aop.xml

References:

http://www.eclipse.org/aspectj/doc/released/adk15notebook/ataspectj-pcadvice.html

http://blog.espenberntsen.net/2010/03/20/aspectj-cheat-sheet/

http://www.eclipse.org/aspectj/doc/next/quick5.pdf

(Using aspects with annotations)
http://stackoverflow.com/questions/2011089/aspectj-pointcut-for-all-methods-of-a-class-with-specific-annotation