C#设计模式概述

概述

        20世纪80年代,四人组(Fang of Four,GoF)将常用的23种软件设计模式进行了归纳整理,自此标志着软件设计模式的正式诞生。它旨在用“模式”来统一和沟通面向对象思想在分析、设计和解决问题之间的鸿沟。在未来的几十年里,它被证明是行之有效的软件开发准则,是通向软件架构师的必经之路,是软件开发领域的“葵花宝典”。

        设计模式是一套被反复使用的、经过合理分类的、用于提高开发效率的设计经验的总结。设计模式本身不包含语法知识,具有“编程语言无关性”(面向对象语言)。本系列文章将以C#语言来系统的介绍这23种常用的设计模式。为了照顾之前没有接触过设计模式的同学,我将以一种“循序渐进的引导方式”,来为大家阐述每一种设计模式的产生背景、优缺点及其适用场景。

面向对象设计原则Object Oriented Design Principle

    面向对象设计原则-单一职责原则(Single Responsibility Principle)

    面向对象设计原则-开放闭合原则(Open-Closed Principle)

    面向对象设计原则-里氏替换原则(Liskov Substitution Principle)

    面向对象设计原则-依赖倒置原则(Dependence Inversion Principle)

    面向对象设计原则-接口隔离原则(Interface Segregation Principle)

    面向对象设计原则-合成复用原则(Composite Reuse Principle)

    面向对象设计原则-迪米特法则(Law of Demeter)

创建型模式(Creational Pattern)

    C#设计模式之0-简单工厂模式(Simple Factory Pattern)

    C#设计模式之1-工厂方法模式(Factory Method Pattern)

    C#设计模式之2-抽象工厂模式(Abstract Factory Pattern)

    C#设计模式之3-建造者模式(Builder Pattern)

    C#设计模式之4-原型模式(Prototype Pattern)

    C#设计模式之5-单例模式(Singleton Pattern)

结构型模式Structural Pattern

    C#设计模式之6-适配器模式(Adapter Pattern)

    C#设计模式之7-桥接模式(Bridge Pattern) 

    C#设计模式之8-组合模式(Composite Pattern)

    C#设计模式之9-装饰者模式(Decorator Pattern)

    C#设计模式之10-外观模式(Facade Pattern)

    C#设计模式之11-享元模式(Flyweight Pattern)

    C#设计模式之12-代理模式(Proxy Pattern)

行为型模式Behavioral Pattern

    C#设计模式之13-职责链模式(Chain of Responsibility Pattern)

    C#设计模式之14-命令模式(Command Pattern)

    C#设计模式之15-解释器模式(Interpreter Pattern)

    C#设计模式之16-迭代器模式(Iterator Pattern)

    C#设计模式之17-中介者模式(Mediator Pattern)

    C#设计模式之18-备忘录模式(Memento Pattern)

    C#设计模式之19-观察者模式(Observer Pattern)

    C#设计模式之20-状态模式(State Pattern)

    C#设计模式之21-策略模式(Stragety Pattern)

    C#设计模式之22-模板方法模式(Template Method Pattern)

    C#设计模式之23-访问者模式(Vistor Pattern)

猜你喜欢

转载自blog.csdn.net/qq_31116753/article/details/81043554