10 2012 档案
摘要:What's refactoring•The process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure.•A disciplined way to clean up code that minimizes the chances of introducing bugsWhy refactoring•Reasons :–Design improvement a
阅读全文
摘要:主要来源:《面向对象设计原理与模式(Java版)》(Object-Oriented Design Using Java) Written by Dale SkrienJava代码的重构模式主要有三种:重命名方法重构模式、引入解释性变量重构模式、以查询取代临时变量重构模式重命名方法重构模式建议执行如下的步骤来完成:1.建立一个具有新名称的方法2.将旧方法的方法体复制进新方法3.讲旧方法的方法体修改为调用新方法4.将所有引用旧方法的地方修改为引用新方法5.删除旧方法引入解释性变量重构模式步骤相对简单,如下:1.声明一个局部变量,并将其初始化为需要替换的表达式部分2.对于复杂的表达式,用新的局部变量
阅读全文
摘要:在java.util.regex包 中,包括了两个类,Pattern(模式类)和Matcher(匹配器类)。Pattern类是用来表达和陈述所要搜索模式的对象,Matcher类是真 正影响搜索的对象。另加一个新的例外类,PatternSyntaxException,当遇到不合法的搜索模式时,会抛出例外。Matcher extends Object implements MatchResult通过解释 Pattern 对 character sequence 执行匹配操作的引擎。通过调用模式的 matcher 方法从模式创建匹配器。创建匹配器后,可以使用它执行三种不同的匹配操作:matches
阅读全文
摘要:Normal 0 false false false EN-US ZH-CN X-NONE ...
阅读全文