Skip to content

wangzz719/design_patterns

Repository files navigation

design_patterns(设计模式)

Design Patterns In Python

Design Patterns Introduction(设计模式介绍)

Design Patterns Introduction(设计模式介绍)

Strategy Pattern(策略模式)

实现:design_patterns/strategy.py

示例:examples/strategy_example.py

Observer Pattern(观察者模式)

实现:design_patterns/observer.py

示例:examples/observer_example.py

Decorator Pattern(装饰者模式)

实现:design_patterns/decorator.py

示例:examples/decorator_example.py

Factory Pattern(工厂模式)

工厂方法模式

实现:design_patterns/factory_method.py

示例:examples/pizza_factory_example.py

抽象工厂模式

实现:design_patterns/abstract_factory.py

示例:examples/pizza_factory_example_2.py

Singleton Pattern(单例模式)

基于装饰器

实现:design_patterns/singleton_decorator.py

示例:examples/singleton_decorator_example.py

基于继承

实现:design_patterns/singleton_baseclass.py

示例:examples/singleton_baseclass_example.py

基于元类

实现:design_patterns/singleton_metaclass.py

示例:examples/singleton_metaclass_example.py

python 官方实现

Singleton

Command Pattern(命令模式)

实现:design_patterns/command_pattern.py

示例:examples/command_pattern_example.py

Adapter Pattern (适配器模式)

实现:design_patterns/adapter_pattern.py

示例:examples/adapter_pattern_example.py

Facade Pattern (外观模式)

示例:examples/facade_pattern_example.py

Template Method Pattern (模板方法模式)

实现:design_patterns/template_method.py

示例:examples/template_method_example.py

Iterator Pattern (迭代器模式)

实现:design_patterns/iterator_pattern.py

Composite Pattern (组合模式)

实现:design_patterns/composite_pattern.py

示例:examples/composite_pattern_example.py

State Pattern (状态模式)

实现:design_patterns/state_pattern.py

示例:examples/state_pattern_example.py

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages