Once I've isolated and removed the duplicated code, both the number classifier and the prime-number tester are much simpler. Listing 4 shows the refactored number classifier.
当我隔离和移除重复代码后,数字分类器和质数检验器就变得更简单了。
Once I have extracted this class, I can refactor both the functional classifier and prime-number tester to use it.
一旦提取了该类之后,我就能通过同时重构函数分类器和质数检验器来使用它。
To illustrate code reuse and its implications, I return to a version of the number classifier that previous installments use to illustrate code structure and style.
要说明代码重用及其含义,我要回过来谈谈先前文章说明代码结构和风格所用的数字分类器。
应用推荐