📄 200604241243545.html
字号:
<html>
<head><title>面向对象分析与设计</title></head>
<center><h1>面向对象分析与设计</h1></center>
<div><P align=right><FONT color=#f70938><FONT face=黑体><a href="200604112229525.html" tppabs="http://www.itisedu.com/phrase/200604112229525.html" target="_new">中科永联</a>高级技术培训中心(</FONT><FONT face=黑体>www.itisedu.com</FONT><FONT face=黑体>)<IMG src="2006415173932413.jpg" tppabs="http://www.itisedu.com/manage/Upload/image/2006415173932413.jpg" border=0></FONT></FONT></P>
<P><FONT face=Verdana> <a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604151739485.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604151739485.html'" tppabs="http://www.itisedu.com/phrase/200604151739485.html" target="_new">OOAD</a>(<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604231338435.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604231338435.html'" tppabs="http://www.itisedu.com/phrase/200604231338435.html" target="_new">Object</a> Orient Analysis & Design,<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604241243385.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604241243385.html'" tppabs="http://www.itisedu.com/phrase/200604241243385.html" target="_new">面向对象的分析和设计</a>,<FONT face=Verdana><a href="200604241243545.html" tppabs="http://www.itisedu.com/phrase/200604241243545.html" target="_new">面向对象分析与设计</a></FONT>)是现代<a href="200604232134205.html" tppabs="http://www.itisedu.com/phrase/200604232134205.html" target="_new">软件</a>企业广为采用的一项有效技术。OOAD方法要求在设计中要映射现实世界中指定问题域中的<a href="200603090845215.html" tppabs="http://www.itisedu.com/phrase/200603090845215.html" target="_new">对象</a>和实体,例如:顾客、汽车和销售人员等。这就需要设计要尽可能地接近现实世界,即以最自然的方式表述实体。所以<a href="200603101726185.html" tppabs="http://www.itisedu.com/phrase/200603101726185.html" target="_new">面向对象</a>技术的优点即为能够构建与现实世界相对应的问题模型,并保持他们的结构、关系和行为为<a href="200603061709535.html" tppabs="http://www.itisedu.com/phrase/200603061709535.html" target="_new">模式</a>。</FONT></P>
<P><FONT face=Verdana> 大师说:"没有不变的<a href="200603101518295.html" tppabs="http://www.itisedu.com/phrase/200603101518295.html" target="_new">需求</a>,世上的软件都改动过3次以上,唯一一个只改动过两次的软件的拥有者已经死了,死在去修改需求的路上。" </FONT></P>
<P><FONT face=Verdana> 目前众多的软件项目有什么样的问题呢?早些时候上ERP的企业在企业发展的时候发现原有的ERP系统需要改进,可是要改进或者是更改现有的ERP系统,唯一的方法就是重新开发一个ERP系统。这对于企业来说是笔不小的支出。此时,落后的<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200603011147495.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200603011147495.html'" tppabs="http://www.itisedu.com/phrase/200603011147495.html" target="_new">信息系统</a>就成为制约企业发展的重要因素。是什么原因造成了这种情况呢?主要的因素是传统的系统分析是在假定需求不变的情况下进行的,这样可以把企业的资源配置到最优的程度。可是在现代瞬息万变的社会,一个企业固守旧有模式,势必会在竞争中处于劣势(因此现在也出现了"<a href="200603302222545.html" tppabs="http://www.itisedu.com/phrase/200603302222545.html" target="_new">组件</a>化"的ERP,这是题外话)。既然企业的需求是变化的、不稳定的,那么以变化的需求为基础建立起来的企业信息系统当然也就不稳定了。这时候,有个问题就产生了,前面我们已经说过,需求是项目的根本,既然需求都是不稳定的,那么何以建立起稳定的企业信息系统呢? </FONT></P>
<P><FONT face=Verdana> 要回答这个问题,首先要比较面向过程和面向对象的开发方法的差别,传统的面向过程的开发方法在前20年大行其道,为中国企业的信息化建设立下了汗马功劳。之所以称为面向过程,是因为开发的焦点集中于过程,开发者集中于以函数为核心的过程,例如前些年很多人试图编写一些通用转账函数来满足银行的需求。面向过程的开发语言包括:Cobol、Pascal、C及C的变形语言。面向对象的概念是在近10年才进入中国的,而它的思想至今也没有真正意义上得到普及。简单的说,面向对象就是面向世界,世界上的任何事物都是对象,因此面向对象是很自然的思想,是符合我们的思维习惯的。面向对象的语言包括了Smalltalk、C++、Java,还有Object Pascal,以及刚刚诞生的C#。 </FONT></P>
<P><FONT face=Verdana> 需求是不稳定的,那么需求之中是不是没有稳定的东西呢?有的,就是对象。世界都是由对象组成的,而对象都是持久的,例如动物、植物已经有相当长的时间。虽然对象也在变化,动物,植物也在不断的进化。但对象在一个相当长的时期内都存在,动植物的存在时间肯定比任何一家企业长久。面向对象的开发方法的精髓就是从企业的不稳定需求中分析出企业的稳定对象,以企业对象为基础来组织需求、构架系统。这样得出的系统就会比传统的系统要稳定得多,因为企业的模式一旦变化,只需要将稳定的企业对象重新组织就行了。这种开发的方法就被称为OOAD(Object Orient Analysis & Design 面向对象的分析和设计),而分析出的企业对象就被称为Common <a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604240816305.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604240816305.html'" tppabs="http://www.itisedu.com/phrase/200604240816305.html" target="_new">Business Object</a>。</FONT></P>
<P><FONT face=Verdana>围棋与OOAD的几个相似点:</FONT></P>
<P><FONT face=Verdana>活棋与对象</FONT></P>
<P><FONT face=Verdana> 一块活棋至少有两个眼位,一个对象或<a href="200603090857555.html" tppabs="http://www.itisedu.com/phrase/200603090857555.html" target="_new">类</a>(有用的)至少要有一个属性和一个方法。眼位表明了这块棋存在的理由,属性和职责同样表明了一个对象存在的理由。</FONT></P>
<P><FONT face=Verdana>简单与复杂</FONT></P>
<P><FONT face=Verdana> 围棋构成简单,一黑一白,以简单构建复杂,与对象方法的理念相同。</FONT></P>
<P><FONT face=Verdana>棋盘与边界</FONT></P>
<P><FONT face=Verdana> 围棋的棋盘有边界,系统有系统边界。</FONT></P>
<P><FONT face=Verdana>定式与模式</FONT></P>
<P><FONT face=Verdana> 下围棋有定式,<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200602281513385.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200602281513385.html'" tppabs="http://www.itisedu.com/phrase/200602281513385.html" target="_new">面向对象方法</a>有分析模式和<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200603061631585.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200603061631585.html'" tppabs="http://www.itisedu.com/phrase/200603061631585.html" target="_new">设计模式</a>。都是个中高手们长期实践的经验结果。</FONT></P>
<P><FONT face=Verdana> 当然更主要的相似之处,应该在方法和过程上。围棋谁都会下,不就是在棋盘上圈地,看谁圈的多吗。但是高手与低手的水平却有天壤之别。例如:</FONT></P>
<P><FONT face=Verdana>1、 围棋忌讳把棋下成"愚形",就是一大块棋坨在一起,行棋效率不高,对于对象就是紧耦合,一个复杂的对象负担太重,同样效率不高;</FONT></P>
<P><FONT face=Verdana>2、 一个围棋高手能够灵活运用各种定式和"手筋",看到两颗子,就能推测以后的种种演化,一个面向对象的设计高手可以灵活地运用各种设计模式,画几张图就能描绘未来的宏伟系统;</FONT></P>
<P><FONT face=Verdana>3、 围棋有"金角银边草肚皮"的说法,在系统分析中首先根据系统边界来确定系统的主要功能和外部接口也是最有效的做法,俗称"<a href="200604240937105.html" tppabs="http://www.itisedu.com/phrase/200604240937105.html" target="_new">用例</a>驱动"。</FONT></P>
<P><FONT face=Verdana>4、 围棋有"大场",强调大局观,系统分析也要求分析人员把握全局,从错综复杂的业务逻辑当中洞察最主要的矛盾。</FONT></P>
<P><FONT face=Verdana> 整个行棋的过程都是演进的、逐步精化的,每一阶段没有明显的区分。针对主要需求的设计可以首先完成,阶段性设计成果一旦确定,就可以转移到下一个"大场"。符合面向对象方法的"统一过程"理论。</FONT></P>
<P><FONT face=Verdana>开局与<a href="200603062220345.html" tppabs="http://www.itisedu.com/phrase/200603062220345.html" target="_new">需求分析</a></FONT></P>
<P><FONT face=Verdana> 下棋的两个人好比一个是分析师,一个是用户,开始谁也不知道谁想干什么,通过一问一答的方式明确需求。高手的对话只需要寥寥几子就知道对方的路数,有经验的分析师几个回合就对系统了然在胸。</FONT></P>
<P><FONT face=Verdana>布局与<a href="200604241328115.html" tppabs="http://www.itisedu.com/phrase/200604241328115.html" target="_new">架构</a>设计</FONT></P>
<P><FONT face=Verdana> 至于布局选择"中国流"还是"韩国流",就相当于系统架构是DotNET还是<a href="200603091447335.html" tppabs="http://www.itisedu.com/phrase/200603091447335.html" target="_new">J2EE</a>,都是根据用户具体的需求和设计师的临场判断做出的。</FONT></P>
<P><FONT face=Verdana>中盘与详细设计</FONT></P>
<P><FONT face=Verdana> 根据架构展开对象和类的设计,棋盘上渐渐浮现一块块活棋的模样。经过几轮不断的"精化"和"转换",大局已定。至于关子,就是编码阶段,交给<a href="200604232224305.html" tppabs="http://www.itisedu.com/phrase/200604232224305.html" target="_new">程序</a>员去做吧。</FONT></P>
<P><FONT face=Verdana> 最后,如果你能够从棋盘上看出一幅对象交互图来,那么恭喜你,你快走火入魔了。</FONT></P><FONT face=Verdana>
<P><BR> 如果继续列举,可能还能发现不少相似之处,可是这样不免有生拉硬扯之嫌,也不是我写这篇文字的本意。下围棋与系统设计都是需要高超智慧的,其中蕴涵着丰富的方法论和哲理。经常听说,有围棋高手宁可输棋,也不愿下出形状难看的棋来,他们称之为艺术,看着棋盘上一块块活棋,简洁而高效,互通而互动,他们感觉到一种享受。而优秀的设计又何尝不是一种艺术呢,一个由对象构成的系统,每个对象都各司其职,<a href="200603090938465.html" tppabs="http://www.itisedu.com/phrase/200603090938465.html" target="_new">消息</a>在其中合理而流畅的传递着。你不觉得也是一种享受吗?</P>
<P> 而其中最为高妙的地方就在于"平衡"。高手对局,胜负往往只有半目,棋盘上双方棋子的分布和契合可以用完美来形容,这就达到了平衡的极至,此时输赢已经不重要,弈者已经得到了他所要的。</P>
<P> 平衡是一种美。</FONT></P></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -