4 ms·
I'm a dev with 10+ years professional Java experience and something more like this is what I wish Java had always had. Ignore the other commenters who are being
by bedobi 3y ago
I'm a dev with 10+ years professional Java experience and something more like this is what I wish Java had always had. Ignore the other commenters who are being predictably and characteristically harsh and uncharitable.
- misja111 3y agoFrameworks such as Spring used to be much more like this, until the annotation hype started to kick in somewhere around 2010. I always thought this was a bad idea. Sure, annotations work nice in a small demo app, but in a large application you want to have everything explicit and under your direct control.
- krzyk 3y agoSpring used xml to configure that so no that similar.
- ElectricalUnion 3y agoThe alternative was "effectively stringly-typed XML forest" that was only checked at runtime; even worse for tooling that the current annotation (and recursive/nested annotation in the case of Spring) thing modern Java is.
- elric 3y agoI think spring's giant XML config file was preferable to the annotation garbage that most people use these days. But both are shitty solutions in my book. I'm still not convinced that doing all this configuration and magic at runtime is a good idea. Most of what spring does in terms of dependency injection (and probably a bunch of configuration related things as well) should really be compile time steps. There are very few cases where you want to change the implementation of $foo at runtime, and being explicit about those few cases would be nice.
- bedobi 3y ago> Frameworks such as Spring used to be much more like this Not really. Spring has always had problems with pointless complexity and turning what should be compile time errors into runtime ones. Its original schtick was DI, which you've always been able to do by just... sending dependencies in through the constructor, lol? No framework or magic needed. The emperor really has no clothes and I wish more people would admit that.