电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本
换一换
首页 金锄头文库 > 资源分类 > PPT文档下载
分享到微信 分享到微博 分享到QQ空间

软件设计模式(一)

  • 资源ID:75498339       资源大小:419KB        全文页数:65页
  • 资源格式: PPT        下载积分:10金贝
快捷下载 游客一键下载
账号登录下载
微信登录下载
三方登录下载: 微信开放平台登录   支付宝登录   QQ登录  
二维码
微信扫一扫登录
下载资源需要10金贝
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
支付方式: 支付宝    微信支付   
验证码:   换一换

 
账号:
密码:
验证码:   换一换
  忘记密码?
    
1、金锄头文库是“C2C”交易模式,即卖家上传的文档直接由买家下载,本站只是中间服务平台,本站所有文档下载所得的收益全部归上传人(卖家)所有,作为网络服务商,若您的权利被侵害请及时联系右侧客服;
2、如你看到网页展示的文档有jinchutou.com水印,是因预览和防盗链等技术需要对部份页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有jinchutou.com水印标识,下载后原文更清晰;
3、所有的PPT和DOC文档都被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;下载前须认真查看,确认无误后再购买;
4、文档大部份都是可以预览的,金锄头文库作为内容存储提供商,无法对各卖家所售文档的真实性、完整性、准确性以及专业性等问题提供审核和保证,请慎重购买;
5、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据;
6、如果您还有什么不清楚的或需要我们协助,可以点击右侧栏的客服。
下载须知 | 常见问题汇总

软件设计模式(一)

软件设计模式(一),潘爱民 http:/www.icst.pku.edu.cn/CompCourse,Why Patterns?,内容,从一个例子看模式 关于模式的研究情况 介绍一些重要的模式(部分) 第三次作业,一个设计例子,VC/Samples/MFC/OLE/DrawCli,DrawCli的基础,MFC提供的基础 Doc/View结构 Doc提供了强大的数据管理功能 View提供了强大的显示功能 splitwnd功能 CWinApp/CMainFrame 提供了一套命令处理流程 对OLE的封装 Active Container OLE Clipboard Property Page 数据结构管理功能 CObject/CObList,我们的设计焦点,用C+对象来表示每一个图元 定义图元的公共接口 如何处理用户的操作 鼠标的动作 图元对象的创建和管理,图元基类,class CDrawObj : public CObject / Attributes CDrawDoc* m_pDocument; / owner virtual int GetHandleCount(); virtual CPoint GetHandle(int nHandle); virtual HCURSOR GetHandleCursor(int nHandle); virtual void SetLineColor(COLORREF color); virtual void SetFillColor(COLORREF color); / Operations virtual void Draw(CDC* pDC); virtual void DrawTracker(CDC* pDC, TrackerState state); virtual void MoveTo(const CRect,图元层次结构,CDrawObj CDrawRect CDrawPoly CDrawOleObj ,CDrawObj,CDrawRect,CDrawPoly,CDrawOleObj,图元的创建,永久支持: CDocument:Serialize-CObList:Serialize -CObject:Serialize CDrawObj:Clone DrawTool:创建图元对象,交互操作,键盘和菜单命令 MFC内部机制 鼠标操作 在CDrawView的鼠标处理函数中处理 工具箱:工具链,有一个当前活动工具 转交给当前活动工具来处理,工具箱和CDrawTool,class CDrawTool / Constructors public: CDrawTool(DrawShape nDrawShape); / Overridables virtual void OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint,DrawTool层次结构,CDrawTool CSelectTool CRectTool CPolyTool ,CDrawTool,CSelectTool,CRectTool,CPolyTool,例子中的模式,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,Patterns支持软件结构和设计的重用 抓住了特定领域中问题的成功解决方案中的静态、动态结构和相互之间的协作关系 patterns与开发语言无关,但是建立在一定的环境基础上 例如:经典的MVC、Factory Method frameworks支持细节设计和代码的重用 framework是一组组件的综合,这些组件相互协作,为一族相关应用提供了一个可重用的框架结构 例如:MMC、MS Script Engine 两者结合起来, design patterns and frameworks有助于提高软件的质量 比如:重用性,扩展性,性能,可维护性,Design pattern与framework(续),a framework supplies the infrastructure and mechanisms that execute a policy for interaction between abstract components with open implementations. frameworks are often said to abide by the Hollywood Principle (“Don't call us, we'll call you.“) 比较: Design patterns are more abstract than frameworks Design patterns are smaller architectural elements than frameworks Design patterns are less specialized than frameworks framework与class library(toolkit),Pattern的研究情况,关于pattern研究的历史 A Pattern Language,Christopher Alexander,1977 “Advanced C+:Programming Styles and Idioms”,James Coplien,1992 “Design Patterns: Elements of Reusable Object-Oriented Software”,GOF,1995 “Pattern-Oriented Software Architecture: A System of Patterns” (简称为“POSA”) ,GoV,1996 .,Pattern is a hot topic,在amazon上查找包含patterns的书(2002.12.12),Pattern的研究现状,pattern与Java pattern与CORBA pattern与系统结构 pattern与generic programming结合 其他(例如UML等),POSA中的模式分类,Architectural Patterns 表达了软件系统的基本结构组织形式或者结构方案 它包含一组预定义的子系统,规定了这些子系统的责任,同时还提供了用于组织和管理这些子系统的规则和向导 Design Patterns 为软件系统的子系统、组件或者组件之间的关系提供一个精炼之后的解决方案 它描述了在特定环境下,用于解决通用软件设计问题的组件以及这些组件相互通信时的可重现结构 Idioms 是一个与编程语言相关的低级模式 它描述了如何实现组件的某些功能,或者利用编程语言的特性来实现组件内部要素之间的通信功能,POSA: Architectural Patterns(1),Architectural Patterns are very high-level structural patterns. Also called “Conceptual Patterns ” From Mud to Structure: Organize components. Layers: Organize components into layers where layer i's services are only used by layer i+1. Pipes and Filters: Divide the task into several sequential processing steps - the output of task i is the input of task i+1. Blackboard: Several independent programs work cooperatively on a common data structure. Distributed Systems :Handle distributed computation. Broker: Introduce a broker component to to achieve better decoupling of clients and servers - brokers accept requests from clients and forward the requests to servers, then return the results back to the clients.,POSA: Architectural Patterns(2),In

注意事项

本文(软件设计模式(一))为本站会员(luoxia****01802)主动上传,金锄头文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即阅读金锄头文库的“版权提示”【网址:https://www.jinchutou.com/h-59.html】,按提示上传提交保证函及证明材料,经审查核实后我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.