Saturday 31 October 2009

Project Lombok: Put an End to Java Verbosity

If you're interested in java programming involving lots of beans, this is a crazy cool tool.

Its a combination of a compile-time and a development-time code generator, which has made Java POJO verbosity history.
It uses annotation magic to implement all the repetitive boring bean methods (getters, setters, equals, hashCode, toString)
without them actually cluttering your classes. Thats right it generates invisible code!

Now you have to watch the video at:
http://projectlombok.org/

You can reed this introductory article:
http://www.devx.com/Java/Article/42946/1954

See some other cool examples to look at:
http://projectlombok.org/features/Data.html
http://projectlombok.org/features/Cleanup.html (I was trying to implement this one just a couple of weeks ago)
http://projectlombok.org/features/EqualsAndHashCode.html

I came across lombok while trying to figure out if I can get eclipse to also generate the .equals and .hashCode methods
on new JPA entities like netbeans does. turns out it I don't really need that any more.

No comments:

Post a Comment