Home  >  Q&A  >  body text

What is the role of dependency injection? It seems so troublesome.

sacred

细嗅蔷*细嗅蔷*2308 days ago1676

reply all(2)I'll reply

  • Summer

    Summer2018-07-19 11:37:05

    Dependency injection is a series of tools and methods whose ultimate goal is to help us develop loosely coupled, maintainable, and testable code and programs. The approach to this principle is known as interface-oriented, or abstract-oriented programming.

    reply
    0
  • 无忌哥哥

    无忌哥哥2018-07-19 09:07:01

    Dependency injection is more convenient in some cases. You can use it or not. It mainly depends on your own choice to decide whether to use it or not

    reply
    0
  • 细嗅蔷*

    I think using containers is very good. It can be loaded statically, the code is not as messy as before, and the logic is much clearer T^T

    细嗅蔷* · 2018-07-22 02:27:54
  • Cancelreply