Tuesday 10 July 2012

Do not implement/generate getters and setters!

Project lombok is a java library which prevents you from implementing or generating getters and setters for POJOs. You just add annotation on the class or on the individual property. Having such code, that just gets and sets properties is unmaintainable and bad for class clarity.
This library has also some other useful features like f.e. @Delegate - annotation that ease creating classes with delegation methods.

Here you can see examples:http://projectlombok.org/features/index.html

No comments: