摘要: 装饰模式(3)设计模式原则: 对于类,我们要做到易于扩展、修改闭合。装饰模式: 为对象动态添加属性,提供一种可以替代继承来扩展类功能的方法。示例代码:using System;usingSystem.Collections.Generic;using System.Linq;using System.Text;using System.IO;usingSystem.Security.Cryptography;namespace Hello{ //饮料抽象类 publicabstract class Beverage { protectedstring description = "U 阅读全文
posted @ 2011-09-25 19:05 Erebus_NET 阅读(67) 评论(0) 推荐(0) 编辑