依赖注入和控制反转

依赖注入和控制反转

问题描述:

依赖关系的具体实现是什么意思?

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...