Giter Site home page Giter Site logo

designpattern's Introduction

常用的设计模式

设计原则

单一职责原则(SRP)	  功能单一
开放封闭原则(OCP)	  对扩展开放,对修改关闭
里氏代替原则(LSP)	  子类能替换父类
依赖倒置原则(DIP)	  抽象不依赖于细节,细节依赖于抽象
接口隔离原则(ISP)	  单一接口
合成复用原则(CRP)	  优先使用合成和聚合的关系“has a”
和迪米特原则(LoD)	  类之间的松耦合

设计模式

1、行为型模式
    1.1、模板方法模式
    1.2、观察者模式
    1.3、命令模式
    1.4、状态模式
    1.5、责任链模式
    1.6、解释器模式
    1.7、中介者模式
    1.8、访问者模式
    1.9、策略模式
    2.0、备忘录模式
    2.1、迭代器模式
2、创造型模式
    2.1、简单工厂模式
    2.2、工厂方法模式
    2.3、抽象工厂模式
    2.4、建造者模式
    2.5、原型模式
    2.6、单例模式
3、结构型模式
    3.1 适配器模式
        注重转换接口,将不吻合的接口适配对接
    3.2 桥接模式
        注重分离接口与其实现,支持多维度变化
    3.3 组合模式
        注重统一接口,将“一对多”的关系转化为“一对一”的关系
    3.4 装饰者模式
        注重稳定接口,在此前提下为对象扩展功能
    3.5 外观模式
        注重简化接口,简化组件系统与外部客户程序的依赖关系
    3.6 享元模式
        注重保留接口,在内部使用共享技术对对象存储进行优化
    3.7 代理模式
        注重假借接口,增加间接层来实现灵活控制
4、并发型模式

designpattern's People

Contributors

houbincarson avatar

Watchers

 avatar

designpattern's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.