3 ms·
Dependency injection has seen its day. The gains promised by DI/IoC containers tend to be outweighed by the complexity they introduce. I'm looking at you, Spri
by revscat 13y ago
Dependency injection has seen its day. The gains promised by DI/IoC containers tend to be outweighed by the complexity they introduce.
I'm looking at you, Spring.
- laureny 13y agoSpring's DI is terrible but Guice (and on mobile, Dagger) is really easy to work with, statically typed and has increased the maintainability and testability of our code base tremendously.
- UK-AL 13y agoAdding @Inject is hard now? Most DI frameworks automatically configure, and register objects. So literally all you need to add is the annotation. Then you can override the automatic registration with you own, with different implementation when required.
- altcognito 13y agoDI is fine, it's just the way people overuse it that's an abomination. I general inject the most significant pieces, or the pieces that are changed. I won't even introduce DI unless I know I'm going to setup a different config of it. My coworkers (sigh), insist that nearly everything must be injected to "eliminate dependencies". (and because it makes it "easier to test"). YMMV