摘要: // 引入策略模式,将工作划分开来// 应用依赖注入,让"执行工作"由注入的实例来完成具体内容.// 这样,新增的工作独立完成,哪里使用哪里修改using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1.EighthTest{ class EighthTest { public void DoTest() { 员工 小薇 = new 员工(); 小薇.工作 = new 运营魔兽世界(); 小薇.执行工作(); Console.ReadLine(); 阅读全文
posted @ 2011-07-11 16:06 规定 阅读(375) 评论(0) 推荐(0) 编辑