Exploring compile-time metaprogramming tools
Compile-time metaprogramming involves code transformations and generation that occur during the compilation phase. In other words, operations, transformations, or code generation are performed on a program during the compilation process – that is, before the program is executed. Macros, code generators, and annotation processors are common tools for compile-time metaprogramming in Java. Given the subject of this book, compile-time metaprogramming will be our main focus since we think that the instruments and frameworks that fall under this definition are the best ways to keep your code clean. In particular, we’ll focus on code generator tools: programming languages and tools that provide facilities for generating code based on certain specifications or models (in the following section, we will focus specifically on Lombok and MapStruct). The code generated by these tools can be customized according to the specific requirements...