摘要: 模板模式: 定义一个算法的几本框架和操作步骤,在其派生类中具体实现算法实现步骤的细节,派生类不改变算法的结构。using System;usingSystem.Text;usingSystem.IO;namespace Hello{ public abstract class CaffeineBeverageWithHook { public voidPrepareRecipe() { BoilWater(); Brew(); PourInCup(); if (CustomerWantsCondiments()) { AddCondiments(); } } public abstract v 阅读全文
posted @ 2011-10-04 22:24 Erebus_NET 阅读(91) 评论(0) 推荐(0) 编辑