In PHP, there is a construct that I find very elegant and which is great for Lombok. It saves code in the usual Spring constructor injections:
In PHP, you can write the following:
php
Then, in the background, it results in the following:
php
This simplification could also be implemented in Lombok, right?
For example, in Java:
java
What do you think?
Thanks for your feedback...
Why not
@RequireArgsConstructor
class MyClass {
final MyService service;
}
Jan
--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/project-lombok/d0eb2dd4-52cc-426b-a2b2-a075214c0ad7n%40googlegroups.com.
Why not use the default injection Annotations (@Inject, @Autowired) into member variables, that most such frameworks provide?
Why do you need a constructor for that?
To view this discussion visit https://groups.google.com/d/msgid/project-lombok/CAGQiuTXeDqoXW9%2BNLys_g6SEYTRLnR3fTc5heXYRm_-nRh_O_w%40mail.gmail.com.
That's the Diskussion "field Injektion vs. Constructor injection". Ctor injection makes the dependencies visible which should be better for unit tests without DI framework.
To view this discussion visit https://groups.google.com/d/msgid/project-lombok/CAL8Ju5n6J9ONcZYU6W_P%3DN_mT8o3PXHFAhzE_bBXfWP3ukroDw%40mail.gmail.com.