3 ms·
Another problem with large Java DI framesorks is that they obscure (with xml and weird conventions) a fundamentally simple operation. They also often resort to
by julian_1 9y ago
Another problem with large Java DI framesorks is that they obscure (with xml and weird conventions) a fundamentally simple operation. They also often resort to state-changing property-setters versus pure constructor args.
Dependency injection - is just making all the dependencies of a class/function explicit on construction, with a secondary affect that an implied ordering is needed to creating complicated nested objects.
Avoiding hidden state-channels (globals) that can't be easily modified is valuable for being able decipher/reason about behavior, and for mocking test instances.
- pabl0rg 9y agoMost Java DI doesn't use XML these days. Spring projects typically use java config. There's also Guice, Dagger, and if you're using Kotlin, Kapsule is even better than the others.