Tagged articles
2 articles
Page 1 of 1
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 21, 2024 · Backend Development

Using Lombok @RequiredArgsConstructor to Reduce @Autowired Boilerplate in Spring Services

This article explains how Lombok's @RequiredArgsConstructor can replace repetitive @Autowired field injections in Spring services by generating a constructor for final fields, demonstrates the underlying annotation‑processing mechanism, and provides practical code examples for applying this technique in backend Java projects.

AutowireBackend DevelopmentDependencyInjection
0 likes · 8 min read
Using Lombok @RequiredArgsConstructor to Reduce @Autowired Boilerplate in Spring Services
Programmer DD
Programmer DD
Oct 12, 2022 · Backend Development

Why Lombok @Data + @Builder Breaks No‑Args Constructors and How to Fix It

This article explains why combining Lombok's @Data and @Builder annotations removes the automatically generated no‑argument constructor, demonstrates the compilation process behind Lombok, and provides two practical solutions using @Tolerate or @RequiredArgsConstructor/@NoArgsConstructor to restore the missing constructor.

@DataBuilderCompilation
0 likes · 6 min read
Why Lombok @Data + @Builder Breaks No‑Args Constructors and How to Fix It