Giter VIP home page Giter VIP logo

designpatternpractice's Introduction

DesignPatternPractice

设计模式学完之后名字和实现对不上,写点示例代码好记一些。

含以下设计模式:

  • 创建型模式
    • 单例模式:为了实现系统中只有一个对象的实例。
    • 工厂模式:实现对象的声明和实例化的解耦。
      • 简单工厂:一个静态工厂方法获取所有类型的产品。
      • 工厂方法:一个产品一个工厂。
      • 抽象工厂:针对产品族,一个工厂。
    • 建造者模式:用于构造复杂对象,将对象的构建和各部件的实现解耦。
    • 原型模式:采用克隆的方法避免创建代价很大的对象。
  • 结构型模式
    • 功能拓展型
      • 适配器模式:为了现有对象符合新的需求接口。
      • 桥接模式:将抽象和实现解耦,典型的API调用模式。
      • 代理模式:和使用原对象一样使用代理对象,不透明的改变类的行为。
      • 装饰器模式:动态透明的添加一个类的功能。
    • 结构简化型
      • 组合模式:处理属性结构的对象,等价的对待单个对象和组合对象。
      • 外观模式:为用户定义一个简单的接口,实现用户和内部系统关系之间的解耦。
      • 享元模式:将对象的状态划分成内部状态和外部状态,通过共享外部对象来减少内存的占用。
  • 行为型模式

designpatternpractice's People

Contributors

yu961549745 avatar

Watchers

James Cloos avatar  avatar

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.