【问题标题】:what are differences Dependency Injection, Inversion of Control, or Service Locator?依赖注入、控制反转或服务定位器有什么区别?
【发布时间】:2014-12-29 15:18:42
【问题描述】:

两者有什么区别 - 依赖注入 (DI) - 控制反转 (Ioc) - 服务定位器?

还有为什么在开发 WebAPI 时需要并使用 Unity?

【问题讨论】:

    标签: entity-framework asp.net-mvc-4 asp.net-web-api unity-container


    【解决方案1】:

    根据Wikipedia

    控制反转或 IoC 是描述某些软件架构设计的一个方面的抽象原理,其中与过程编程相比,系统的控制流是反转的

    基本上控制反转是一种设计模式依赖注入服务定位器是实现反转的方法控制权。

    Read this article for getting clear understanding

    另请阅读 MSDN article on Inversion of ControlInversion of Control and Dependency Injection

    您还应该阅读this good CodeProject article on Inversion of Control

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-08
    • 1970-01-01
    • 2015-01-09
    • 2012-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多