依赖注入和控制反转 [英] Dependency Injection and inversion of control
本文介绍了依赖注入和控制反转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
依赖关系的具体实现是什么意思?
what does " concrete implementations of the dependencies" means?
推荐答案
依赖的具体实现意味着针对具体类而不是接口进行编程。所以依赖类更加紧密耦合。所以应该考虑使用接口来避免这种耦合。
依赖注入和控制反转的良好读数
关于依赖倒置原理,控制和依赖倒置的绝对初学者教程注入 [ ^ ]
希望这会有所帮助......
A concrete implementation of dependency means programming against a concrete class instead of interface. So the dependency classes are more tightly coupled. So should consider use interface to avoid this coupling.
A good read for Dependency injection and inversion of control
An Absolute Beginner's Tutorial on Dependency Inversion Principle, Inversion of Control and Dependency Injection[^]
Hope this helps...
这篇关于依赖注入和控制反转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文