设计模式
blacop
这个作者很懒,什么都没留下…
展开
-
装饰设计模式的演示
/*装饰设计模式的演示 装饰设计模式: 当想要对已有的对象进行功能增强时, 可以定义类,将已有对象传入,基于已有的功能,并提供加强功能。 那么自定义的该类称为装饰类装饰类通常会通过构造方法接受被装饰的对象。 并基于被装饰的对象,提供更强的功能。 */ class Person { public void chifan() { System.out.println("原创 2016-07-21 16:37:23 · 410 阅读 · 0 评论 -
装饰和继承
/*装饰和继承 MyReader//专门用于读取数据的类 |--MyTextReader |--MyBufferTextreader |--MyMediaReader |--MyBufferMediaReader |--MyDataReader |--MyBufferDataReaderclass MyBufferReader原创 2016-07-21 17:09:27 · 222 阅读 · 0 评论 -
简单工厂设计模式计算器
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace 简单工厂设计模式计算器 { class Program { static void Main(string[] args原创 2016-10-21 22:29:20 · 473 阅读 · 0 评论 -
简单工厂的核心 根据用户的输入创建对象赋值给父类
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace _03简单工厂设计模式 { class Program { static void Main(string[] args原创 2016-10-15 13:08:48 · 268 阅读 · 0 评论 -
打开文件练习
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks;namespace 打开文件练习 { class Program {原创 2016-10-26 14:29:09 · 290 阅读 · 0 评论