Verthandii/go-pattern

作为一个go开发者对于设计模式的个人理解

★ 4Forks 1GoGitHub ↗Compare

README

go-pattern

前言

  1. 不要为了模式而模式,一般情况下代码简洁才是最重要的
  2. 在新需求可能彻底推翻旧需求的情况下,尽量不要使用设计模式(设计模式大部分情况下会让代码变得复杂)
  3. 先理解每个模式的动机,再谈设计
  4. go 语言的设计模式不应该止步于 GoF 的 23 种设计模式,函数是一等公民的语言应有更多的设计可深究

Creational Patterns

Pattern Status
Factory Method ✔
Abstract Factory ✔
Builder ✔
Prototype ✔
Singleton ✔

Structural Patterns

Pattern Status
Facade ✔
Adapter ✔
Proxy ✔
Composite ✔
Flyweight ✔
Decorator ✔
Bridge ✔

Behavioral Patterns

Pattern Status
Mediator ✘
Observer ✘
Command ✘
Iterator ✘
Template Method ✘
Strategy ✘
State ✘
Interpreter ✘
Memento ✘
Chain of Responsibility ✘
Visitor ✘

Contributors

Verthandii

Issues