大头
Table_bottom

标签云
Table_bottom

分类
Table_bottom

日历
二月
28293031123
45678910
11121314151617
18192021222324
252627282912
Table_bottom

评论
Table_bottom

留言
Table_bottom

微博
Table_bottom

热门文章
Table_bottom

随机文章
Table_bottom

豆瓣上谁关注这里
Table_bottom

链接
Table_bottom

搜索栏
Table_bottom

RSS
RSS Link
Table_bottom

功能
Table_bottom

页面
Table_bottom

计数器
463931
Table_bottom

访客统计
Table_bottom

存档
Table_bottom

重构 - 090808

loveisbug posted @ 2009年8月08日 19:05 in 学习 with tags 重构 , 1882 阅读

6.2 Inline Method

紧随Extract Method之后,作者也说了,间接层有其价值,但不是所有间接层都有价值。

6.4 Replace Temp with Query

说到性能问题,在重构时可以降低性能问题的优先级,因为很多情况下不会造成影响。如果性能真的出了问题,也可以在优化时期解决它。如果代码组织良好,往往能帮助发现更有效的优化方案。当然,如果性能真的是在受到了很大的影响,可以再恢复回去。

10.4 Separate Query from Modifier

任何有返回值的函数,都不应该有看得到的副作用。


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter