AOP syntax problem

I have been trying to use AOP for a few months. One problem that I face is the syntax. I started with AspectWerkz. When they added support for JDK 5.0 I learnt to use that syntax. I am learning aspectj after they merged with it. Now AspectJ is introducing JDK 5 syntax. It is getting
more difficult with the introduction of generics support.

Though JDK 5 didn’t make it simpler, it seems that the syntax of different AOP frameworks is making the adoption harder. Sometimes it is difficult to keep track of what is in what version.

I have rewritten my AOP code using AspectJ 5 syntax after I
read this article


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class StatusReportAspect {

@Pointcut("execution(@com.blueprint.util.annotation.StatusShow * *..*(..))")
void statusMethods(){};

@Before("statusMethods()")
public void before( final JoinPoint jp ) {
try{
Class clazz = PaperSheet.class;
Method method = clazz.getMethod(
jp.getSignature().getName(),
Graphics2D.class);
if( method.isAnnotationPresent(
StatusShow.class )){

BluePrint.getStatus().setText(
method.getAnnotation( StatusShow.class ).
message() );
}
}catch( Throwable t ){
t.printStackTrace();
//This is benign. Just ignore.
}
}
}

What I cannot do with generics ?

My first brush with Java generics was around 3 years back when I found a prototype compiler from Gilad Bracha ( I think ). Though I never delved too deep into that, I recently realised that one way to learn generics is to check what java generics can’t do that C++ templates can.

I came across a “abstract subclass” that we can’t write using java. AFAIK this is not our regular
java subclass that is abstract. The “Curiously Recurring Template Pattern (CRTP)” is one such instance.

There is no point in trying this C++ template trick using generics because the type is erased. So the controversial type erasure can teach you a lot of things that you can do with Java generics.

Process tailoring

After my quest to understand software engineering and processes and UML started I have read so many books. I came across technical terms like XP, RUP, TDD, MDD, MDA and UML. The latest is DSL. There are comparisons of Evo, RUP, XP and SCRUM with each other.

Process engineering seems to be a black art. Eventhough Incremental and iterative development is something I like very much, Offshore development centers don’t leave much to choice. How do you adopt true IID ? How do you convince your manager ?

I read a book by Kent Beck that explains XP but before I could use it practically I read
“The irony of Extreme Programming” by Matt Stephens and Doug Rosenberg in the May 2004 issue of Dr. Dobb’s Journal.

The article states that “XP consists of 12 highly interdependent practices. However, each
individual practice does not stand up on its own. Each relies on at least one other practice”

I recently sent a message to the XP mailing list to understand this interdependency. Somebody there asked me to read “XP Explained” by Kent Beck. Oh ! Well.

You can read the thread here http://groups.yahoo.com/group/extremeprogramming/message/100875
 

Classic MVC

I found this noteworthy article on the reasons for the M-V-C split. Read http://www.objectmentor.com/resources/articles/taskmast.pdf. I feel that any decent Swing application could use this article for a cleaner separation of concerns.

This is my first post.