摘要:
6、抽象工厂模式 使用一个对象,生产指定的产品(不会参杂其他的产品的东西) namespace SJ.DesignMode { /// <summary> /// 设计模式 /// </summary> class Program { static void Main(string[] args) 阅读全文
posted @ 2021-12-21 14:18
二维一加零
阅读(40)
评论(0)
推荐(0)
摘要:
namespace SJ.DesignMode { /// <summary> /// 设计模式 /// </summary> class Program { static void Main(string[] args) { SingleDistance s = SingleDistance.Cr 阅读全文
posted @ 2021-12-21 14:16
二维一加零
阅读(22)
评论(0)
推荐(0)
摘要:
5、工厂方法模式(未完成) 阅读全文
posted @ 2021-12-21 14:16
二维一加零
阅读(13)
评论(0)
推荐(0)
摘要:
3、适配器模式 提供适配器的类,此类可以根据传参的类,执行不同的类的实现 namespace SJ.DesignMode { /// <summary> /// 设计模式 /// </summary> class Program { static void Main(string[] args) { 阅读全文
posted @ 2021-12-21 14:14
二维一加零
阅读(13)
评论(0)
推荐(0)
摘要:
2、外观模式 一个类的一个方法中执行其他类的方法,客户端操作方便 //把需要暴露给外部的功能集中到外观中 //什么时候使用? 多层结构系统、松散偶尔、简化客户端使用 namespace SJ.DesignMode { /// <summary> /// 设计模式 /// </summary> cla 阅读全文
posted @ 2021-12-21 14:12
二维一加零
阅读(13)
评论(0)
推荐(0)
摘要:
1、简单工厂 (调用静态方法实例化需要的类) class Program { static void Main(string[] args) { //1、简单工厂 IMan man = Factory.Create(FactoryType.Student); man.Go(); } } public 阅读全文
posted @ 2021-12-21 14:09
二维一加零
阅读(30)
评论(0)
推荐(0)

浙公网安备 33010602011771号