dependency inversion principle vs factory pattern in C#

This question already has an answer here:

  • Dependency Injection vs Factory Pattern 26 answers

  • I think these 2 are slightly different topics, however both about software design. DIP is more about how you should arrange your dependencies in a class, and Factory is a pattern which you can use to instantiate those dependencies.

    There is a good article from Bob Martin on principles of object oriented design (SOLID included) - http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

    Also, please consider to read this article by Martin Fowler on Inversion of Control and Dependency Injection.

    链接地址: http://www.djcxy.com/p/77750.html

    上一篇: 依赖注入vs服务位置

    下一篇: C#中依赖倒置原则vs工厂模式