摘要: 在平时的项目开发中,我们会通过构造方法传参来实例化对象。 但在需要多个参数时,如果继续使用构造方法实例,编写代码会非常麻烦,而且在其他项目成员传参时特别容易出现传参错误的情况,这时我们不妨来使用Builder模式进行编写。 在使用Builder模式之前,我们先看下重叠构造器模式和JavaBeans模 阅读全文
posted @ 2017-05-21 15:13 I.Striving 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 添加StringEx类public static class StringEx { public static int ToInt(this string str) { int number = default(int); ... 阅读全文
posted @ 2014-12-25 17:23 I.Striving 阅读(77) 评论(0) 推荐(0) 编辑