DIP,IOC,DI

DIP(dependency inversion principle)依赖倒转

IOC(inversion of control)反转控制

DI(dependency injection)依赖注入

dip是一种思想,依赖倒转之后,使得上层不依赖下层,下层变动后无需改变上层。

IOC主要通过接口的方式让上层不依赖下层,是dip的实现;下层实现上层接口,下层增加模块后实现上层接口即可。

di是反转控制的框架,真正的管理映射依赖,用于创建管理对象。

参考:http://www.cnblogs.com/liuhaorain/p/3747470.html

猜你喜欢

转载自blog.csdn.net/qq_27803495/article/details/49618333
今日推荐