设计模式
dfzone
这个作者很懒,什么都没留下…
展开
-
设计模式回顾之-----简单工厂(静态方法)
工厂模式中的一种,属于创建型设计模式,主要用来建立类的实例。 using System;using System.Collections.Generic;using System.Text;namespace 简单工厂{ class Program { //抽象梦想类,现在允许你有个梦想 public abstract原创 2009-04-28 22:44:00 · 214 阅读 · 0 评论 -
设计模式回顾之-----工厂方法
using System;using System.Collections.Generic;using System.Text;namespace 工厂模式{ class Program { //抽象商品 public abstract class Product { publi原创 2009-04-29 22:35:00 · 182 阅读 · 0 评论 -
设计模式回顾之-----策略模式
场景是这样,五一快到了,想要回家看看,怎么回去呢,不可能靠11路吧~那现在就要选择一种方式了。可是,选择要根据腰包里的钱啊,有钱,好,飞机,又快又舒服。可惜,穷人一个,只好火车了,哈哈...using System;using System.Collections.Generic;using System.Text;namespace 策略模式{ class Pr原创 2009-04-28 21:53:00 · 215 阅读 · 0 评论 -
设计模式回顾之-----单体模式
using System;using System.Collections.Generic;using System.Text;namespace 单件模式{ class Program { //定义一个密封类,防止继承 public sealed class President {原创 2009-04-28 22:34:00 · 153 阅读 · 0 评论