Understanding the need for a DI framework

前端 未结 12 1813
长情又很酷
长情又很酷 2020-12-07 12:39

This might be a naive question. I\'m currently learning the Spring framework and dependency injection. While the basic principle of DI is rather easy to grasp, it\'s

12条回答
  •  没有蜡笔的小新
    2020-12-07 13:31

    Don't forget one major disadvantage of dependency injection: you loose the ability to easily find out from where something is initialized using Find Usages of your powerful Java IDE. This might be a very serious point if you refactor a lot and want to avoid that the test code is 10 times bigger than the application code.

提交回复
热议问题