依赖注入

“High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.”这是依赖倒置的定义。
 
 The client only needs to know about the intrinsic interfaces of the services because these define how the client may use the services. This separates the responsibility of "use" from the responsibility of "construction".
 
 
 
大领导讲话,一层一层的,不应该说出具体的细节,应该只说出抽象的概念,如果说得太细节,高层就依赖于底层是否完成的正确与否, 而说出抽象的概念,底层就去依赖高层了,自己去实现这个抽象的东西,将控制权交给了领导。
 
 
 
https://www.zhihu.com/question/23277575
 
posted @ 2020-01-13 00:50  hh9515  阅读(91)  评论(0)    收藏  举报