JasonChang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. 

  example duck application

  same super class, same function name, different function implementation

 

 

 

structure:

posted on 2013-11-22 16:31  JasonChang  阅读(206)  评论(0编辑  收藏  举报