标签:des style blog io color sp div log bs
void Main() { Product product = new Product(); product.Set(new ShowA()); product.Show(); product.Set(new ShowB()); product.Show(); } class Product{ IShow ishow; public void Set(IShow isw){ishow=isw;} public void Show(){ ishow.Show(); } } interface IShow { void Show(); } class ShowA:IShow{ public void Show(){} } class ShowB:IShow{ public void Show(){} }
DesignPattern_Behavioral_Strategy
标签:des style blog io color sp div log bs
原文地址:http://www.cnblogs.com/rammderek/p/4103117.html