Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Pattern #160

Open
hhstore opened this issue Jun 9, 2019 · 4 comments
Open

Design Pattern #160

hhstore opened this issue Jun 9, 2019 · 4 comments

Comments

@hhstore
Copy link
Owner

hhstore commented Jun 9, 2019

No description provided.

@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

设计模式:

  • 我们通常讨论的设计模式, 指的是 《设计模式》(GOF)23式.
  • 这23种模型, 可以理解成23种问题场景的最佳实践.
  • 也就是解题模板, 套路.
  • java社区比较爱讨论设计模式, 面试必聊. 其他语言反而不怎么讨论.
  • 设计模式, 是对复杂问题域的简化. 本身是降低抽象复杂度的.
  • 坏处是: 各种小白, 滥用设计模式, 强行套模型, 把简单问题复杂化.
  • 一直比较少讨论设计模式, 主要是Python等语言设计本身, 以及隐含了大量设计模式.
  • 写Python代码, 无时无刻都在用, 只是意识不到而已.
  • Python的 迭代器, 装饰器 实现本身, 就是设计模式的应用.

比较常用的设计模式:

  • 装饰器
  • 迭代器
  • 工厂方法
  • 单例模式
  • 状态模式

ref:

image

@hhstore
Copy link
Owner Author

hhstore commented Jun 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant