摘要: 具体就是在工厂中保存对象的引用,通过共享对象来减少内存的开销.对象之间的差异使用外部对象来处理. class Program { /// <summary> /// 享元模式例子 /// </summary> /// <param name="args"></param> static void M 阅读全文
posted @ 2020-03-12 14:50 夏风微凉 阅读(147) 评论(0) 推荐(0)
摘要: .net 中使用此模式只需要实现接口 ICloneable class Program { static void Main(string[] args) { Person p1 = new Person() { Name = "xz", Age = 1 }; Person p2 = (Person 阅读全文
posted @ 2020-03-12 13:27 夏风微凉 阅读(132) 评论(0) 推荐(0)
摘要: 需要用到这个是因为在asp.net Web Form 中使用ashx 的时候没有一个好的模型绑定.所以我找到了dll 中自带的.并且将他封装了一下 代码如下: public class ModelBinder { public static BinderResultModel<T> BindMode 阅读全文
posted @ 2020-03-12 00:19 夏风微凉 阅读(284) 评论(0) 推荐(0)