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