# py-patterns **Repository Path**: linux_dev/py-patterns ## Basic Information - **Project Name**: py-patterns - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-14 - **Last Updated**: 2021-12-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README py-patterns =========================== 设计模式的`Python3.X`版本 ### 分类 #### 1. 创建型模型 - 简单工厂 [simple_factory](https://github.com/wklken/py-patterns/blob/master/Creational/simple_factory.py) - 抽象工厂 [abstract_factory](https://github.com/wklken/py-patterns/blob/master/Creational/abstract_factory.py) - 建造者 [builder](https://github.com/wklken/py-patterns/blob/master/Creational/builder.py) - 工厂方法 [factory_method](https://github.com/wklken/py-patterns/blob/master/Creational/factory_method.py) - 原型 [prototype](https://github.com/wklken/py-patterns/blob/master/Creational/prototype.py) - 单例 [singleton](https://github.com/wklken/py-patterns/blob/master/Creational/singleton.py) #### 2. 结构型模型 - 适配器 [adapter](https://github.com/wklken/py-patterns/blob/master/Structural/adapter.py) - 桥接 [bridge](https://github.com/wklken/py-patterns/blob/master/Structural/bridge.py) - 组合 [composite](https://github.com/wklken/py-patterns/blob/master/Structural/composite.py) - 装饰 [decorator](https://github.com/wklken/py-patterns/blob/master/Structural/decorator.py) - 外观 [facade](https://github.com/wklken/py-patterns/blob/master/Structural/facade.py) - 享元 [flyweight](https://github.com/wklken/py-patterns/blob/master/Structural/flyweight.py) - 代理 [proxy](https://github.com/wklken/py-patterns/blob/master/Structural/proxy.py) #### 3. 行为型 - 观察者 [observer](https://github.com/wklken/py-patterns/blob/master/Behavioral/observer.py) - 模板方法 [abstract](https://github.com/wklken/py-patterns/blob/master/Behavioral/template_method.py) - 命令 [command](https://github.com/wklken/py-patterns/blob/master/Behavioral/command.py) - 状态 [state](https://github.com/wklken/py-patterns/blob/master/Behavioral/state.py) - 责任链 [chain_of_responsibility](https://github.com/wklken/py-patterns/blob/master/Behavioral/chain_of_responsibility.py) - 解释器 [interpreter](https://github.com/wklken/py-patterns/blob/master/Behavioral/interpreter.py) - 中介者 [mediator](https://github.com/wklken/py-patterns/blob/master/Behavioral/mediator.py) - 访问者 [visitor](https://github.com/wklken/py-patterns/blob/master/Behavioral/visitor.py) - 策略 [strategy](https://github.com/wklken/py-patterns/blob/master/Behavioral/strategy.py) - 备忘录 [memento](https://github.com/wklken/py-patterns/blob/master/Behavioral/memento.py) - 迭代器 [iterator](https://github.com/wklken/py-patterns/blob/master/Behavioral/iterator.py) ### 参考 - 大话设计模式 - 图解设计模式 - [python-patterns](https://github.com/faif/python-patterns) ### TODO: - review with https://github.com/faif/python-patterns # Donation You can Buy me a coffee:) [link](http://www.wklken.me/pages/donation.html) ------------------------ ------------------------ wklken Email: wklken@yeah.net Github: https://github.com/wklken Blog: [http://www.wklken.me](http://www.wklken.me) 2015-08-24 ShenZheng 2020-03-13 [HuQianshan](https://github.com/huqianshan)