3 ms·
Java Without the Boilerplate – Project Lombok
- Confusion 16y agoLombok is awesome. However, it's probably impossible to introduce into an environment that's even remotely enterprisey. The main problem with Lombok is that its future is very uncertain: Lombok works by replacing parts of the Java AST with their own modified classes. They gain access to the AST by (ab)using the ability to hook up your own annotation preprocessor. However, the (API of the) AST is unstable and no guarantees about it are given whatsoever. That means Lombok may break with every minor release of the java compiler, which means it will be hard to justify introducing it. I certainly didn't dare introducing it with any of my clients, back when I was still writing Java. If someone else has to deal with the code later on, and perhaps a decade from now: forget about it, until this kind of AST access is standardized and supported by Oracle.
- karthikm 16y agoCtrl + Shift + /(on numpad) works enough for me to hide boilerplate code on Eclipse. We also lose ability to add annotations (say for validation on Struts action classes) to the getters/setters.