gitmyhub

golang-design-pattern

Go ★ 9.0k updated 8mo ago

设计模式 Golang实现-《研磨设计模式》读书笔记

A learning reference with working Go code examples for all 23 classic software design patterns, creational, structural, and behavioral, organized one pattern per folder.

Gosetup: easycomplexity 1/5

This repository is a collection of example code in Go that demonstrates classic software design patterns. Design patterns are reusable solutions to common problems that come up repeatedly when building software. Rather than inventing a new approach every time, developers use these named patterns as a shared vocabulary and starting point.

The repository is described as reading notes from the book "Research on Design Patterns" and covers 23 patterns organized into three categories. The first category, creational patterns, covers ways to create objects: Simple Factory, Factory Method, Abstract Factory, Builder, Prototype, and Singleton. The second category, structural patterns, covers how to organize or combine components: Facade, Adapter, Proxy, Composite, Flyweight, Decorator, and Bridge. The third category, behavioral patterns, covers how components communicate and coordinate: Mediator, Observer, Command, Iterator, Template Method, Strategy, State, Memento, Interpreter, Chain of Responsibility, and Visitor.

Each pattern has its own folder in the repository containing Go code that shows how to implement it. The README is written in Chinese and serves mainly as an index linking to each of the 23 pattern folders on GitHub.

This is primarily a learning resource. If you are studying Go and want to understand how established design patterns look when written in Go specifically, or if you are learning design patterns for the first time and want working code examples alongside your reading, this repository provides a concise reference.

Where it fits