AspectJ and DRY principle
Posted on April 1, 2007
IMHO this is sooo uncool. All this repetition and parameter jugging is probably there for a reason. But I just can’t see it.
I would have designed the syntax for anonymous pointcuts like this:
before() : call (void Account.credit(float)) && target(account) && args(amount) { System.out.println("Crediting" + amount + " to " + account); }
and for named pointcuts
pointcut creditOperation : call (void Account.credit(float)) && target(account) && args(amount) before() : creditOperation { System.out.println("Crediting" + amount + " to " + account); }
Since the compiler already has this information, let it figure out the parameters and target objects.
Filed Under Uncategorized | Leave a Comment
Leave a Comment
If you would like to make a comment, please fill out the form below.