![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
程序设计模式
dwm88888888
这个作者很懒,什么都没留下…
展开
-
c# 装饰者模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 装饰者模式{ //建立咖啡的抽象类 public abstract class Coffee { pu...原创 2018-06-04 11:49:49 · 824 阅读 · 1 评论 -
c# 组合模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 组合模式{ public abstract class FileObject { public string N...原创 2018-06-07 18:31:36 · 317 阅读 · 0 评论 -
c# 外观模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 外观模式{ //登录名 public class LoginName { public string N...原创 2018-06-07 21:10:02 · 327 阅读 · 0 评论 -
c# 桥接模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 桥接模式{ public abstract class TV { public abstract void On...原创 2018-06-07 11:07:19 · 381 阅读 · 0 评论 -
c# 适配器模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 适配器模式{ //定义一个电脑 public interface Computer { void Re...原创 2018-06-07 10:17:02 · 428 阅读 · 0 评论 -
c# 原型模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 原型模式{ //细胞 public abstract class Cell { public strin...原创 2018-06-07 09:45:19 · 277 阅读 · 0 评论 -
c# 建造者模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 建筑者模式简单例子{ //创建老板 public class Boss { public void Ma...原创 2018-06-07 09:21:00 · 442 阅读 · 0 评论 -
c# 抽象工厂模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 抽象工厂模式{ //生产镜片 public abstract class Lenses { public...原创 2018-06-06 21:49:36 · 1555 阅读 · 0 评论 -
c# 工厂模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;/*工厂方法模式 所有的产品都基于同一个产品类,产品对应的产品工厂类都基于同一个工厂类,每一个工厂类都有一个返回对应产品类的方法,他是简单工厂模式的扩展*/n...原创 2018-06-06 20:07:09 · 456 阅读 · 0 评论 -
c# 简单工厂模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;/*简单工厂模式,工厂类返回一个子类对象*//* * 应用场景 * 1,当工厂类负责创建的对象比较少时可以考虑使用简单工厂模式 * 2,客户如果只知道传入工厂类...原创 2018-06-06 17:26:40 · 1370 阅读 · 0 评论 -
c# 单例模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;/*单例模式确保一个类只有一个实例,并提供一个全局访问点*/namespace 单例模式{ public class Singleton { ...原创 2018-06-05 22:46:27 · 1638 阅读 · 0 评论 -
c# 享元模式简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 享元模式{ public abstract class abStudent { public string Na...原创 2018-06-08 11:11:55 · 619 阅读 · 0 评论