For now I'm writing tidbits about computer programming, the plan is to actually blog at some point in time.

Friday, May 30, 2008

just wrote the first batch of code for lego4j

Would you like to be able to write code like this ?


public class Foo {
@RetryOnException( E.class, 1 )
public String bar( int arg1 ) throws E {
return doSomeThingThatMightThrowE( arg1 );
}
}

instead of having to write something like this:

public class Foo {
public String bar( int arg1 ) throws E {
int retries = 0;
while (true) {
try {
return doSomeThingThatMightThrowE( arg1 );
}
catch (E e) {
if (retries < 5) {
continue;
}
throw e;
}
}
}
}

This is what lego4j is about, creating a library of lightweight aspects to encapsulate local concerns programmers encounter while writing a generic Java application.

1 comment:

Unknown said...

Very nice work.
I was looking at you pom.xml and you have the dependency on spring stated twice.