今天偶尔逛到Martin Fowler的Blog,在他的Blog中看到了一篇题为“Refactoring Malapropism”的文章。讲的是有关“Refactoring”的误用,同时也讨论了“Refactoring”一词的界定问题。很浅显,却觉得颇有道理。我觉得,其文章的要旨是澄清了Refactoring和Restructuring的区别。
针对一个不日内即将破败的系统的Refactoring不能称其为Refactoring,对于文档的所谓Refactoring也不能称其为Refactoring,而应称为Restructuring。
一般意义上的Restructuring代表了“any rearrangement of parts of a whole”;Refactoring则属于专项技术,特定的Restructuring,采用了小幅的行为保持式的转变。
结合Martin Fowler在其“Refactoring”一书中对Refactoring的定义,上述观点不难理解。看来大师在这方面还是很固执的:)
BTW:There may be other good techniques for restructuring, but they are different —— 还有其他的Restructuring技术,这到是一件很让我好奇的事