using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 外观 { class Program { //做菜需要的材料类 public class Material { //做红烧排骨需要的材料 public void Spareribs() { Console.WriteLine("准备猪排骨500克,葱末、姜末、酱油、花生油、白糖、醋、料酒、盐各适量..."); } //做红烧鱼需要的材料 public void Fish() { Console.WriteLine("准备鱼500克,葱末、姜末、酱油、花生油、白糖、醋、料酒、盐各适量.."); } } //腌制材料类 public class Cure { //腌制排骨 public void Spareribs() { Console.WriteLine("将排骨洗净剁成3厘米长段,用开水汆一下,捞出放盆内,加入盐、酱油腌入味..."); } //腌制鱼 public void Fish() { Console.WriteLine("鱼收拾干净,擦干鱼皮后,表面剌花刀,用盐与姜腌制2-3小时..."); } } //煎炸材料类 public class Fry { //给排骨上色 public void Spareribs() { Console.WriteLine("锅里放一点点油,放入冰糖,用小火炒糖色,熬到糖的颜色变成浅褐色把汆过水的排骨倒入一起翻炒..."); } //炸鱼 public void Fish() { Console.WriteLine("油加热至八成熟,提起演好的鱼尾放入油锅中,炸至两面金黄..."); } } //最后的调汁类 public class Sauce { //红烧排骨调汁 public void Spareribs() { Console.WriteLine("炒锅留少许油烧热,下入葱花、姜末爆香,加入适量清水、酱油、醋、料酒,倒入排骨,烧开后用慢火煨至汤汁浓、排骨熟,出锅即可!"); } //红烧鱼调汁 public void Fish() { Console.WriteLine("留底油,放入花椒、干辣椒、八角、葱姜蒜大火爆香后,放入炸好的鱼,依次放入料酒、生抽、老抽、盐、适量清水,大货烧开后,关中小火烧15-20分钟,出锅即可!"); } } //红烧排骨外观类 public class SpareribsFacade { private Material material=new Material (); private Cure cure=new Cure(); private Fry fry=new Fry(); private Sauce sauce=new Sauce(); public void CookSpareribs() { Console.Write("第一步:"); material.Spareribs (); Console.Write("第二步:"); cure.Spareribs (); Console.Write("第三步:"); fry.Spareribs (); Console.Write("第四步:"); sauce .Spareribs (); } } //红烧鱼外观类 public class FishFacade { private Material material=new Material (); private Cure cure=new Cure(); private Fry fry=new Fry(); private Sauce sauce=new Sauce(); public void CookFish() { Console.Write("第一步:"); material.Fish (); Console.Write("第二步:"); cure.Fish (); Console.Write("第三步:"); fry.Fish (); Console.Write("第四步:"); sauce.Fish (); } } static void Main(string[] args) { //开始做红烧排骨了 Console.WriteLine("----开始做红烧排骨..."); SpareribsFacade spareribsFacade=new SpareribsFacade (); spareribsFacade .CookSpareribs (); Console.WriteLine("----红烧排骨制作完成!"); Console.WriteLine(); //开始做红烧鱼了 Console.WriteLine("----开始做红烧鱼..."); FishFacade fishFacade=new FishFacade (); fishFacade .CookFish (); Console.WriteLine("----红烧鱼制作完成!"); Console.Read(); } } }
原文地址:http://blog.csdn.net/ry513705618/article/details/38520253