﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-信心比金钱更重要！-随笔分类-软件设计</title><link>http://www.cppblog.com/luofeng225/category/18429.html</link><description>目标明确==&gt;&gt;&gt;计划跟踪==&gt;&gt;&gt;行动执行！</description><language>zh-cn</language><lastBuildDate>Fri, 20 Apr 2012 09:06:00 GMT</lastBuildDate><pubDate>Fri, 20 Apr 2012 09:06:00 GMT</pubDate><ttl>60</ttl><item><title>设计的本质 </title><link>http://www.cppblog.com/luofeng225/archive/2012/04/17/171702.html</link><dc:creator>luofeng</dc:creator><author>luofeng</author><pubDate>Tue, 17 Apr 2012 01:02:00 GMT</pubDate><guid>http://www.cppblog.com/luofeng225/archive/2012/04/17/171702.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 设计的本质在于营造引人入胜的杀手级用户体验。&nbsp;&nbsp;<a href='http://www.cppblog.com/luofeng225/archive/2012/04/17/171702.html'>阅读全文</a><img src ="http://www.cppblog.com/luofeng225/aggbug/171702.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/luofeng225/" target="_blank">luofeng</a> 2012-04-17 09:02 <a href="http://www.cppblog.com/luofeng225/archive/2012/04/17/171702.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>重构是个好东西</title><link>http://www.cppblog.com/luofeng225/archive/2012/03/28/169274.html</link><dc:creator>luofeng</dc:creator><author>luofeng</author><pubDate>Wed, 28 Mar 2012 07:23:00 GMT</pubDate><guid>http://www.cppblog.com/luofeng225/archive/2012/03/28/169274.html</guid><wfw:comment>http://www.cppblog.com/luofeng225/comments/169274.html</wfw:comment><comments>http://www.cppblog.com/luofeng225/archive/2012/03/28/169274.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/luofeng225/comments/commentRss/169274.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/luofeng225/services/trackbacks/169274.html</trackback:ping><description><![CDATA[<div><span style="color: #333333; font-family: Arial; line-height: 26px; "><p>*<strong>重构</strong>（名词）：对软件内部的一种调整，目的是在不改变软件可观察行为的前提下，提高其可理解性，降低其修改成本。</p><p>*重构（动词）：使用一系列重构手法，在不改变软件可观察行为的前提下，调整其结构。<br /><br /><br /></p><div><strong>为何重构？</strong><br /><div><p style="font-weight: normal; ">1.重构改进软件设计</p><p style="font-weight: normal; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 如果没有重构，程序的设计会逐渐腐败变质。</p><p style="font-weight: normal; ">代码结构的流失是累积性的。经常性的重构可以帮助代码维护自己该有的形态。</p><p style="font-weight: normal; ">代码减少并不会使系统运行更快，因为这对程序的运行轨迹几乎没有任何明显影响。然而代码量减少将使未来可能的程序修改动作容易得多。</p><p style="font-weight: normal; ">2.重构使软件更容易理解</p><p style="font-weight: normal; ">3.重构帮助找到bug</p><p style="font-weight: normal; ">4.重构提高编码速度</p><p><span class="Apple-style-span" style="font-weight: normal; ">良好的设计是快速开发的根本。</span><br /><br /><br /></p><div><p style="font-weight: bold; ">何时重构</p><p>&nbsp;</p><ol><li style="font-weight: normal; "><strong><div style="display: inline !important; "><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; ">.三次法则</p></div></div></strong><strong><div style="display: inline !important; "><p style="display: inline !important; "></p><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; "></p><ol style="display: inline !important; "><li style="display: inline !important; "><strong><div style="display: inline !important; "><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; ">第一次做某件事时只管去做；第二次做类似的事会产生反感，但无论如何还是可以去做；第三次再做类似的事，你就应该重构。</p></div></div></strong></li></ol></div></div></strong><strong><div style="display: inline !important; "><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; ">事不过三，三则重构</p></div></div></strong></li><li style="font-weight: normal; "><strong><div style="display: inline !important; "><p style="display: inline !important; "></p><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; ">添加功能时重构。</p></div></div></strong></li><li style="font-weight: normal; "><strong><div style="display: inline !important; "><p style="display: inline !important; "></p><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; ">修补错误时重构。</p></div></div></strong></li><li style="font-weight: normal; "><strong><div style="display: inline !important; "><p style="display: inline !important; "></p><div style="display: inline !important; "><p style="font-weight: normal; display: inline !important; ">复审代码时重构。<br /></p></div><p>&nbsp;</p></div></strong></li></ol><p>&nbsp;</p></div><p>&nbsp;</p></div></div><p>&nbsp;<span class="Apple-style-span" style="font-family: verdana, 'courier new'; line-height: 21px; color: #000000; ">2.5重构的难题</span></p></span><div><p>数据库</p><p>使用分隔层或者使用对象数据库。</p><p><br />修改接口</p><p>让旧接口调用新接口。</p><p>*不要过早发布接口。请修改你的代码所有权政策，使重构更顺畅。</p><p>难以通过重构手法完成的设计改动。</p><p><br />何时不该重构</p><p>重构之前，代码必须起码能够在大部分情况下正常运行。</p><p>如果项目已近最后期限，应该避免重构。</p><p>如果最后没有足够时间，通常表示早该进行重构了。<br /><br /></p><p>2.6重构与设计</p><p>重构改变了预先设计的角色。</p><p>要建造一个灵活的解决方案，所需的成本难以估计。<br /><br /></p><p>2.7重构与性能</p><p>三中编写快速软件的方法：</p><p>1.时间预算法。</p><p>2.持续关注法。</p><p>3.优化关键部位</p><p><br /></p></div></div><img src ="http://www.cppblog.com/luofeng225/aggbug/169274.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/luofeng225/" target="_blank">luofeng</a> 2012-03-28 15:23 <a href="http://www.cppblog.com/luofeng225/archive/2012/03/28/169274.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>软件开发的几条原则</title><link>http://www.cppblog.com/luofeng225/archive/2011/12/28/162984.html</link><dc:creator>luofeng</dc:creator><author>luofeng</author><pubDate>Wed, 28 Dec 2011 07:27:00 GMT</pubDate><guid>http://www.cppblog.com/luofeng225/archive/2011/12/28/162984.html</guid><wfw:comment>http://www.cppblog.com/luofeng225/comments/162984.html</wfw:comment><comments>http://www.cppblog.com/luofeng225/archive/2011/12/28/162984.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/luofeng225/comments/commentRss/162984.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/luofeng225/services/trackbacks/162984.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 软件开发的几条原则&nbsp;&nbsp;<a href='http://www.cppblog.com/luofeng225/archive/2011/12/28/162984.html'>阅读全文</a><img src ="http://www.cppblog.com/luofeng225/aggbug/162984.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/luofeng225/" target="_blank">luofeng</a> 2011-12-28 15:27 <a href="http://www.cppblog.com/luofeng225/archive/2011/12/28/162984.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>