- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
软件设计模式(一) 潘爱民 2003-12-12 /CompCourse2003/ 内容 从一个例子看模式 关于模式的研究情况 介绍一些重要的模式(部分) 第三次作业 一个设计例子 VC/Samples/MFC/OLE/DrawCli DrawCli的基础 MFC提供的基础 Doc/View结构 Doc提供了强大的数据管理功能 View提供了强大的显示功能 splitwnd功能 CWinApp/CMainFrame 提供了一套命令处理流程 对OLE的封装 Active Container OLE Clipboard Property Page 数据结构管理功能 CObject/CObList 我们的设计焦点 用C++对象来表示每一个图元 定义图元的公共接口 如何处理用户的操作 鼠标的动作 图元对象的创建和管理 图元基类 图元层次结构 图元的创建 永久支持: CDocument::Serialize-CObList::Serialize-CObject::Serialize CDrawObj::Clone DrawTool:创建图元对象 交互操作 键盘和菜单命令 MFC内部机制 鼠标操作 在CDrawView的鼠标处理函数中处理 工具箱:工具链,有一个当前活动工具 转交给当前活动工具来处理 工具箱和CDrawTool 例子中的模式 CDrawObj和CDrawTool合起来构成了Factory Method模式 CDrawTool::Clone用到了原型创建模式 每一个CDrawTool都是一个singleton Adapter模式:把OLE对象封装成CDrawObj * 可以增加Composite模式 facade模式:通过CDrawDoc/View与MFC通信 chain of responsibility:如鼠标处理工作 * 用Command模式增加undo/redo功能 patterns 定义: A physical arrangement of elements Repeating;with some degree of correspondence in successive trials or observations 典范、范例,事物的标准样式 In the book “Design Patterns”, the design patterns are descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context Design patterns represent solutions to problems that arise when developing software within a particular context 几个近义词 idiom、technique、paradigm About patterns About patterns Documentation of expert software engineers behavior Documentation of specific reoccurring problems (and solutions) Abstraction of common design occurrences Properties of design patterns A pattern addresses a recurring design problem that arises in specific design situations, and presents a solution to it. Patterns document existing, well-proven design experience. Patterns provide a common vocabulary and understanding for design principles. Patterns are a means of documenting software architectures. Patterns support the construction of software with define properties. Patterns help you to manage software complexity. pattern与framework frameworks支持细节设计和代码的重用 framework是一组组件的综合,这些
文档评论(0)