友情提示:如果本网页打开太慢或显示不完整,请尝试鼠标右键“刷新”本网页!阅读过程发现任何错误请告诉我们,谢谢!! 报告错误
狗狗书籍 返回本书目录 我的书架 我的书签 TXT全本下载 进入书吧 加入书签

深入浅出MFC第2版(PDF格式)-第109章

按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!






                      an  extended  collection  of  classes  that  cooperate  to  support  a  plete  application 



                      architecture  or  application  model;  providing  more plete application  development 



                      support than a simple set of class libraries。 



                     * 这里所指的support 并不只是视觉性UI 组件如menu、dialog、listbox。。。,还包括一个应用 



                     程序所需要的其它功能设备,像是Document; View; Printing; Debugging。 



                     另一个相关定义出现在Ray Valdes 于1992 年10 月发表于Dr。 Dobb's Journal  的〃Sizing up 



                     Application Frameworks and Class Libraries〃  一文之中: 



                      An  application  framework  is  an  integrated obj ect…oriented  software  system  that offers 



                      all  the  application…level  classes documents;  views;  and  mands     needed  by  a 

                                                         (                                     ) 



                      generic application。 



                      An  application  framework  is  meant to be  used in  its  entirety;  and  fosters  both  design 



                      reuse and code reuse。 An  application  framework  embodies  a particular philosophy  for 



                      structuring  an  application;  and  in return  for a large mass of  prebuilt  functionality; the 



                      programmer gives up control over many architectural…design decisions。 



                    Donald G。 Firesmith 在一篇名为〃Frameworks : The Golden path of the object Nirvana〃 的 



                     文章中对Application Framework 有如下定义: 



                      What  are  frameworks    They  are  significant  collections  of  collaborating  classes  that 

                                             ? 



                      capture both  the  small…scale patterns  and  maj or  mechanisms  that; in  turn;  implement 



                      the mon requirements and design in a specific application domain。 



                      * Nirvana 是涅盘、最高境界的意思。 



318 


…………………………………………………………Page 381……………………………………………………………

                                                 第5章    總觀Application Framework  



Bjarne Stroustrup (C++ 原创者)在他的The C++ Programming Language 一书中对于 



Application Framework 也有如下叙述: 



 Libraries build out of the kinds of classes described above support design and re…use of 



 code  by  supplying  building  blocks  and  ways  of  bining  them;  the  application 



 builder designs a framework into which these mon building blocks are fitted。 An 



 alternative; and sometimes more ambitious; approach to the support of design and re



 use is to provide code that establishes a mon framework into which the application 



 builder  fits  application…specific  code  as  building  blocks。  Such  an  approach  is  often 



 called an application framework。 The classes establishing such a framework often have 



 such fat interfaces that they are hardly types in the traditional sense。 They approximate 



 the  ideal  of  being  plete  applications;  except  that  they  don't  do  anything。  The 



 specific actions are supplied by the application programmer。 



Kaare Christian 在1994/02/08 的PC Magazine  中有一篇〃C++ Application Frameworks〃 



文章,其中有下列叙述(节录): 



两年前我在纽约北边的乡村盖了一栋post…and…beam 房子。在我到达之前我的木匠已经 



把每一根梁的外形设计好并制作好,把一根根的粗糙木材变成一块块锯得漂漂亮亮的零 



件,一切准备就线程只待安装。 (注:所谓post…and…beam 应是指那种梁柱都已规格化, 



可以邮购回来自己动手盖的DIY ! V Do It Yourself …房子)。 



使用Application Framework 建造一个 Windows 应用程序也有类似的过程。你使用一 



组早已做好的零件,它使你行进快速。由于这些零件坚强耐用而且稳固,后面的工作就 



简单多了。但最重要的是,不论你使用规格化的梁柱框架来盖一栋房子,或是使用 



Application Framework             Windows 程序,工作类型已然改变,出现了一种完 

                        来建立一个 



全崭新的做事方法。在我的post…and…beam 房子中,工作类型的改变并不总是带来帮 



助;贸易商在预制梁柱的技巧上可能会遭遇适应上的困扰。同样的事情最初也发生在 



Windows 身上,因为你原已具备的某些以C 语言写Windows 程序的能力,现在在以 



                                                                                   319 


…………………………………………………………Page 382……………………………………………………………

              第篇    湷觥 FC  程式設計 



              C++ 和Application Framework 开发程序的过程中无用武之地。时间过去之后, 



              Windows 程序设计的类型移转终于带来了伟大的利益与方便。Application Framework 



              本身把message loops 和其它Windows 的苦役都做掉了,它促进一个比较秩序井然 



              的程序结构。 



              Application Framework …建立Windows 应用软件所用的 C++ 类别库…如今已行之 



              有年,因为对象导向程序设计已经快速地获得了接受度。Windows API 是程序性的, 



              Application Framework 则让你写对象导向式的Windows  

                                                     程序。它们提供预先写好的机 



              能(以C++ 类别型式呈现出来),可以加速应用软件的开发。 



              Application Framework 提供数种优点。或许最重要的;是它们在对象导向程序设计模式 



              下对Windows 程序设计过程的影响。你可以使用Framework 来减轻例行但繁复的琐 



              事; 目前的Application Framework 可以在图形、对话框、打印、求助、OCX 控制组件、 



              剪贴簿、OLE 等各方面帮助我们,它也可以产生漂亮的UI 接口如工具栏和状态列。 



              借着Application Framework 的帮助写出来的码往往比较容易组织化;因为Framework 



              改变了Windows 管理消息的方法。也许有一天Framework 还可以帮你维护单一一套 



              码以应付不同的执行平台。 



              你必须对Application Framework有很好的知识   ;才能够修改由它附带的软件开发工具 



              制作出来的骨�
返回目录 上一页 下一页 回到顶部 赞(1) 踩(1)
未阅读完?加入书签已便下次继续阅读!
温馨提示: 温看小说的同时发表评论,说出自己的看法和其它小伙伴们分享也不错哦!发表书评还可以获得积分和经验奖励,认真写原创书评 被采纳为精评可以获得大量金币、积分和经验奖励哦!