Code Monkey home page Code Monkey logo

design_pattern_python's Introduction

design_pattern_python

设计模式-python, python design pattern,基于菜鸟教程的设计模式java实现进行了python重写

[TOC]

写在前面

菜鸟教程 中对常用的设计模式进行了汇总,实现上使用的是java。在本仓库里面对所有的教程涉及到的代码用python进行了重写,同样也有C++版本的实现在另一个仓库进行了管理 C++ 设计模式

设计模式之间的关系

创建型模式

这些设计模式提供了一种在创建对象的同时隐藏创建逻辑的方式,而不是使用 new 运算符直接实例化对象。这使得程序在判断针对某个给定实例需要创建哪些对象时更加灵活。

factory_pattern.py

factory_pattern

abstract_factory_pattern.py

abstract_factory_pattern

singleton_pattern.py

singleton_pattern

build_pattern.py

build_pattern

prototype_pattern.py

prototype pattern

结构型模式

这些设计模式关注类和对象的组合。继承的概念被用来组合接口和定义组合对象获得新功能的方式。

adapter_pattern.py

adapter

bridge_pattern.py

bridge pattern

filter_pattern.py

filter pattern

composite_pattern.py

composite pattern

decorator_pattern.py

decorator pattern

facade_pattern.py

facade pattern

flyweight_pattern.py

flyweight pattern

proxy_pattern.py

proxy pattern

行为型模式

这些设计模式特别关注对象之间的通信。

chain_of_responsibility_pattern.py

command_pattern.py

interpreter_pattern.py

J2EE 模式

这些设计模式特别关注表示层。这些模式是由 Sun Java Center 鉴定的。

design_pattern_python's People

Contributors

cf-zhang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.