摘要: 商场促销活动:打折、满额返现等等主函数对工厂模式和策略模式结合的调用: class Program { static void Main(string[] args) { //简单工厂模式 CashSuper csuper = CashFactory.CreateCashAccept("打8折"); float re = csuper.AcceptCash(100); //策略模式与简单工厂结合用法 CashContext csup = new CashContext("打8折"); float re1 = csup.GetResult(100); Co 阅读全文
posted @ 2012-07-17 09:58 八神吻你 阅读(697) 评论(0) 推荐(0) 编辑