
I am a freelance software developer and software architect in Linz (Austria) since 2006. More about me.
Follow:
Google Plus
RSS-Feed
Follow @dtanzer
My Favourites:
Please correct my grammar
Version Numbers
Direct Call Pattern
Simplicity

I am a freelance software developer and software architect in Linz (Austria) since 2006. More about me.
Follow:
Google Plus
RSS-Feed
Follow @dtanzer
Please correct my grammar
Version Numbers
Direct Call Pattern
Simplicity
We are using Project Lombok in a large project, and I thought I should write a few lines about it. I think it is a really nice idea, but it also causes a lot of troubles. For those who don't know project lombok: It creates a lot of bytecode for you, you just have to annotate your java classes. For example, you can write a java class like:
@Data public class MyBean() {
private final String foo;
private String bar;
private int foobar;
}
Project lombok will then create getters and setters for all private variables, a constructor to initialize all final fields, a nice toString() method and a correct hashCode() method. The cool thing is that it does not create any source code. Instead, project lombok hooks itself into the java compiler and creates the byte code for all these methods.
The bad thing about this is that it is an "ugly hack". They use undocumented features of the java compiler, and you need a special eclipse plugin to make compilation work in eclipse.
This eclipse plugin breaks some of useful features of eclipse:
So, my conclusion is: While project lombok saves you from writing some boiler plate code, it causes more problems than it solves. Especially because I never write getters, setters, equals, hashCode or toString myselft: Eclipse does this for me, and it works fine.