一.OCP简介(OCP--Open-Closed Principle):Software entities(classes,modules,functions,etc.) should be open for extension, but closed for modification.软件实体应当对扩展开放,对修改关闭,即软件实体应当在不修改(在.Net当中可能通过代理模式来达到这个目的)的前提下扩展.Open for extension:当新需求出现的时候,可以通过扩展现有模型达到目的. C…
其他面向对象设计原则3: 依赖倒置原则DIP The Dependency Inversion Principle7.1 依赖倒置原则DIP The Dependency Inversion Principle I. 高层模块不应当依赖低层模块 ,两者都依赖抽象 High-level modules should not depend on low-level modules,Both should depend on abstractions II.抽象不能依赖细节,细节应当依赖抽象 Ab…