Coder Social home page Coder Social logo

design-pattern's Introduction

Design Pattern

Build Status Codecov Go Report Card

Go 实现设计模式,集合简单示例进行说明验证。

类型

创建型

创建型模式关注点是如何创建对象,其核心**是要把对象的创建和使用相分离,这样使得两者能相对独立地变换。

结构型

结构型模式主要涉及如何组合各种对象以便获得更好、更灵活的结构。虽然面向对象的继承机制提供了最基本的子类扩展父类的功能,但结构型模式不仅仅简单地使用继承,而更多地通过组合与运行期的动态组合来实现更灵活的功能。

行为型

行为型模式主要涉及算法和对象间的职责分配。通过使用对象组合,行为型模式可以描述一组对象应该如何协作来完成一个整体任务。

常用设计模式

序号 类型 模式 英文 文档 完成
01 创建型 工厂模式 Factory Pattern 深入设计模式
02 创建型 抽象工厂模式 Abstract Factory Pattern 深入设计模式
03 创建型 单例模式 Singleton Pattern 深入设计模式
04 创建型 建造者模式 Builder Pattern 深入设计模式
05 创建型 原型模式 Prototype Pattern 深入设计模式
06 结构型 适配器模式 Adapter Pattern 深入设计模式
07 结构型 桥接模式 Bridge Pattern 深入设计模式
08 结构型 组合模式 Composite Pattern 深入设计模式
09 结构型 装饰模式 Decorator Pattern 深入设计模式
10 结构型 外观模式 Facade Pattern 深入设计模式
11 结构型 享元模式 Flyweight Pattern 深入设计模式
12 结构型 代理模式 Proxy Pattern 深入设计模式
13 行为型 责任链模式 Chain of Responsibility Pattern 深入设计模式
14 行为型 命令模式 Command Pattern 深入设计模式
15 行为型 迭代器模式 Iterator Pattern 深入设计模式
16 行为型 中介者模式 Mediator Pattern 深入设计模式
17 行为型 备忘录模式 Memento Pattern 深入设计模式
18 行为型 观察者模式 Observer Pattern 深入设计模式
19 行为型 状态模式 State Pattern 深入设计模式
20 行为型 策略模式 Strategy Pattern 深入设计模式
21 行为型 模版模式 Template Pattern 深入设计模式
22 行为型 访问者模式 Visitor Pattern 深入设计模式

参考

  1. 深入设计模式

License

Under the MIT License

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.