mohuishou / Go Design Pattern
golang design pattern go 设计模式实现,包含 23 种常见的设计模式实现,同时这也是极客时间-设计模式之美 的笔记
Stars: ✭ 253
Labels
Projects that are alternatives of or similar to Go Design Pattern
java-design-patterns-web
Java Design Patterns website at https://java-design-patterns.com
Stars: ✭ 81 (-67.98%)
Mutual labels: design-patterns
Software-Design
No description or website provided.
Stars: ✭ 23 (-90.91%)
Mutual labels: design-patterns
adhesion-rs
D-inspired contract programming in Rust using macros
Stars: ✭ 49 (-80.63%)
Mutual labels: design-patterns
data-algorithms-with-spark
O'Reilly Book: [Data Algorithms with Spark] by Mahmoud Parsian
Stars: ✭ 34 (-86.56%)
Mutual labels: design-patterns
laravel-filters
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.
Stars: ✭ 19 (-92.49%)
Mutual labels: design-patterns
DataStructures Algorithms Java
Collection of data structures and algorithms challenges that I've solved. 💤
Stars: ✭ 12 (-95.26%)
Mutual labels: design-patterns
patterns
📰 A collection of UI / UX patterns for different types of applications
Stars: ✭ 67 (-73.52%)
Mutual labels: design-patterns
DoFactorydotNetDesignPattern
http://www.dofactory.com/net/design-patterns
Stars: ✭ 17 (-93.28%)
Mutual labels: design-patterns
design-patterns-java
📗 Classic OOP Design Patterns from GoF, implemented in Java.
Stars: ✭ 25 (-90.12%)
Mutual labels: design-patterns
riblet-sample
A sample to represent Uber Riblets design pattern using Swift.
Stars: ✭ 42 (-83.4%)
Mutual labels: design-patterns
Kodkod
https://github.com/alirizaadiyahsi/Nucleus Web API layered architecture startup template with ASP.NET Core 2.1, EF Core 2.1 and Vue Client
Stars: ✭ 45 (-82.21%)
Mutual labels: design-patterns
dumb delegator
Delegator and SimpleDelegator in Ruby's stdlib are useful, but they pull in most of Kernel. This is not appropriate for many uses; for instance, delegation to Rails models.
Stars: ✭ 62 (-75.49%)
Mutual labels: design-patterns
CSharpDesignPatterns
Examples of design patterns, using C# code.
Stars: ✭ 84 (-66.8%)
Mutual labels: design-patterns
design-patterns-for-parser-combinators
A Really Cool Calculator written in Haskell... or is it?
Stars: ✭ 29 (-88.54%)
Mutual labels: design-patterns
go-design-pattern
总结
原本预计是在十月底更新完毕这个系列,到今天是11-05,晚了几天,不过也还好,这是第一次这么密集的去更新博客上的内容,更多的是以笔记的形式来呈现,加上这篇一共24篇文章差不多两个半月的时间,平均每周输出两篇,感觉还是不错。后续可能会视情况不定期的更新一些实战内容,也有可能没有。接下来下一个系列应该是数据结构与算法,包含对 Go 中一些底层数据和标准库包的学习,例如 slice, sort 等等。
话说回来,回头再看学习设计模式我们究竟需要学习一些什么?
- 写 Go 需要使用到设计模式么?
- 需要,但是切记请勿使用其他语言的方式来写 Go
- 如果看过之前的一些文章,就会发现类似 JAVA 的这些面向对象语言中的某些设计模式的写法在 Go 中会十分的别扭
- 但是 Go 不需要设计模式么?不是的,设计模式的思想是想通的,并且我们一直都在使用,例如我们常见的对象创建方式
NewXXX
这其实就是一个简单工厂
- 设计模式学习的重点是什么?
- 设计原则,以及设计模式的使用场景和优缺点,实现相对来说还没有那么重要
- 如果是常见的设计模式是武术招式,那么设计原则就是内功心法,没有内功心法那么招式套路也就是花架子
- 熟练掌握不同设计模式的使用场景可以帮助我们学会见招拆招,灵活应用而不是只会套路
- 最后设计模式不是银弹,不要拿着🔨就觉得哪里都像是钉子,不要过早优化,持续重构才是正道
设计原则
同时这也是 Code Review 的重要标准之一
设计模式
Go设计模式
- 单例模式包含饿汉式和懒汉式两种实现
- 工厂模式包含简单工厂、工厂方法、抽象工厂、DI容器
- 代理模式包含静态代理、动态代理(采用 go generate 模拟)
- 观察者模式包含观察者模式、eventbus
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].