paul and Jorge wrote:Project Lombock.
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:
paul and Jorge wrote:Project Lombock.
I came across this tool some years ago and very quickly disliked it vehemently.
Maybe it has changed in recent times, but I doubt it because the things everybody loved so much about it was the same set of things that I wanted a million miles away from any codebase I had to support. In my current job, one of the first things I did with one of our Java codebases was to completely remove the dependency on Lombok. No thank you, no way, no way, no way.
...
paul nisset wrote:For example, I've never heard of Prometheus or Project Lombock.
Thanks.
Project Lombok is one of life ’ s little conveniences. Lombok uses simple annotations to eliminate a ton of boilerplate code, such as getters and setters, logging, equals , and hashCode , as well as other scaffolding that might otherwise obscure a Java codebase. Lombok does this through the magic of bytecode reweaving , a process that rewrites the .class files by adding the desired code, without modifying your source files.
You might worry that this will complicate debugging and logging since the source code line numbering won ’ t match the modified class. But in fact, Lombok adjusts for that in the executing code, and the major Integrated Development Environments (IDEs) also handle it gracefully. Admittedly, there are times during intricate debugging sessions where stepping into generated code might be difficult, or cryptic logging messages might surface, for example if an exception is thrown from code that isn ’ t in your codebase!
Some of this might sound like Java “records,” introduced in Java 14. For cases where you need immutable data objects, records would usually be the way to go. But Lombok offers much broader capability, and many enterprise development teams are using it. For those that do, it adds great value.
You also might be thinking that you can use code generation to create getters, setters, equals, etc. The problem with code generation is that you have code that needs to be maintained and risks getting out of sync.
Additionally, code coverage tools will show this generated code as having low coverage.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne wrote:learn about Lombok and then form your own opinion!
Tim Driven Development | Test until the fear goes away
Tim Cooke wrote:In my current job, one of the first things I did with one of our Java codebases was to completely remove the dependency on Lombok
Tim Driven Development | Test until the fear goes away
Consider Paul's rocket mass heater. |