Comment by mrkeen
1 day ago
Agreed. Modern Spring brags about not requiring pages of external XML files like it did in the old days. But plain constructors is still an improvement on both.
1 day ago
Agreed. Modern Spring brags about not requiring pages of external XML files like it did in the old days. But plain constructors is still an improvement on both.
Configurable apps (see "axis" and "role" concepts in distage) are prohibitevely hard to setup and maintain, dual test with sound opt-in memoization are, probably, practically impossible.
So I looked at the examples and it just seems like a lot for a little.
https://izumi.7mind.io/distage/basics.html#activation-axis
I feel like all you need there is a ctor param that takes a greeter and pass in whichever you want.
Those params can be cached as necessary or part of larger config POD objects if they are often passed with other dependencies.
It just gets rid of the boilerplate. Never had a problem with ctor injection in Spring.