# py-patterns **Repository Path**: lb034200/py-patterns ## Basic Information - **Project Name**: py-patterns - **Description**: 设计模式的python实现 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2020-04-30 - **Last Updated**: 2022-08-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README py-patterns =========================== 设计模式的Python版本 ### 分类 #### 1. 创建型模型 - 简单工厂 [simple_factory](https://github.com/wklken/py-patterns/blob/master/simple_factory.py) - 抽象工厂 [abstract_factory](https://github.com/wklken/py-patterns/blob/master/abstract_factory.py) - 建造者 [builder](https://github.com/wklken/py-patterns/blob/master/builder.py) - 工厂方法 [factory_method](https://github.com/wklken/py-patterns/blob/master/factory_method.py) - 原型 [prototype](https://github.com/wklken/py-patterns/blob/master/prototype.py) - 单例 [singleton](https://github.com/wklken/py-patterns/blob/master/singleton.py) #### 2. 结构型模型 - 适配器 [adapter](https://github.com/wklken/py-patterns/blob/master/adapter.py) - 桥接 [bridge](https://github.com/wklken/py-patterns/blob/master/bridge.py) - 组合 [composite](https://github.com/wklken/py-patterns/blob/master/composite.py) - 装饰 [decorator](https://github.com/wklken/py-patterns/blob/master/decorator.py) - 外观 [facade](https://github.com/wklken/py-patterns/blob/master/facade.py) - 享元 [flyweight](https://github.com/wklken/py-patterns/blob/master/flyweight.py) - 代理 [proxy](https://github.com/wklken/py-patterns/blob/master/proxy.py) #### 3. 行为型 - 观察者 [observer](https://github.com/wklken/py-patterns/blob/master/observer.py) - 模板方法 [abstract](https://github.com/wklken/py-patterns/blob/master/abstract.py) - 命令 [command](https://github.com/wklken/py-patterns/blob/master/command.py) - 状态 [state](https://github.com/wklken/py-patterns/blob/master/state.py) - 责任链 [chain_of_responsibility](https://github.com/wklken/py-patterns/blob/master/chain_of_responsibility.py) - 解释器 [interpreter](https://github.com/wklken/py-patterns/blob/master/interpreter.py) - 中介者 [mediator](https://github.com/wklken/py-patterns/blob/master/mediator.py) - 访问者 [visitor](https://github.com/wklken/py-patterns/blob/master/visitor.py) - 策略 [strategy](https://github.com/wklken/py-patterns/blob/master/strategy.py) - 备忘录 [memento](https://github.com/wklken/py-patterns/blob/master/memento.py) - 迭代器 [iterator](https://github.com/wklken/py-patterns/blob/master/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