43

Python设计模式——策略模式(孙悟空用什么打妖怪)-Ttr-51CTO博客

 6 years ago
source link: http://blog.51cto.com/freshair/2069136
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
#coding:utf-8'''策略模式作用:    就是使用多种算法来解决一个问题,最大的特性的是:能够在运行时透明地切换算法(客户端代码对变化无感知)    假如有两种算法,一种对少量的输入效果更好,另一种对大量输入效果更好,则可以使用策略模式在运行时基于  &

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK