3 ms·
People like it because it lets you unit test in Java. Most of the time IoC involves an interface with a single implementation and there will never be a 2nd. No
by sbov 9y ago
People like it because it lets you unit test in Java. Most of the time IoC involves an interface with a single implementation and there will never be a 2nd.
Note that DI is just a form of IoC and both are separate from Spring. You can "manually" do DI by passing objects to constructors yourself. Some people have a complex web of dependencies and Spring can help make this manageable. Other people don't but have a hatred for passing arguments to constructors.