软件工程实践者研的究方法

上传人:nu****n 文档编号:245133661 上传时间:2024-10-07 格式:PPT 页数:39 大小:599KB
返回 下载 相关 举报
软件工程实践者研的究方法_第1页
第1页 / 共39页
软件工程实践者研的究方法_第2页
第2页 / 共39页
软件工程实践者研的究方法_第3页
第3页 / 共39页
点击查看更多>>
资源描述
,Click to edit Master title style,Click to edit Master text styles,Second level,Third level,Fourth level,Fifth level,These slides are designed to accompany,Software Engineering:A Practitioners Approach,7/e,(McGraw-Hill,2009).Slides copyright 2009 by Roger Pressman.,*,Click to edit Master title style,Click to edit Master text styles,Second level,Third level,Fourth level,Fifth level,*,1,Chapter 10,Component-Level Design,Software Engineering:A Practitioners Approach,7/e,by Roger S.Pressman,2,What is a Component?,OMG Unified Modeling Language Specification,OMG01 defines a component as,“a modular,deployable,and replaceable part of a system that encapsulates implementation and exposes a set of interfaces.”,”,OO view:,a component contains a set of collaborating classes,Conventional view:,a component contains processing logic,the internal data structures that are required to implement the processing logic,and an interface that enables the component to be invoked and data to be passed to it.,3,OO Component,4,Conventional Component,5,Conventional Component,6,Basic Design Principles,Open-Closed Principle(开闭原则).,“A module component should be open for extension but closed for modification.,Substitution Principle(替换原则).,“Subclasses should be substitutable for their base classes.,Dependency Inversion Principle(依赖倒置原则).,“Depend on abstractions.Do not depend on concretions(具体实现).”,Interface Segregation Principle(接口分离原则).,“,Many,client-specific interfaces(专用接口)are better than,one,general purpose interface.,Release Reuse Equivalency Principle(发布复用等价原则).,“The granule(粒度)of reuse is the granule of release.”,Common Closure Principle(共同封装原则).,“Classes that change together belong together.(同时变更的类应封装在一起)”,Common Reuse Principle(共同重用原则).,“,Classes that arent reused together should not be grouped together.”,7,Design Guidelines,Components,Naming conventions should be established for components that are specified as part of the architectural model and then refined and elaborated as part of the component-level model,Interfaces,Interfaces provide important information about communication and collaboration(as well as helping us to achieve the OPC),Dependencies and Inheritance,it is a good idea to model dependencies from left to right and inheritance from bottom(derived classes)to top(base classes).,8,Cohesion(内聚度),Conventional view:,the“single-mindedness”of,a module,OO view:,cohesion,implies that a component or class encapsulates only attributes and operations that are closely related to one another.,Levels of cohesion(内聚度依次递减),Functional,Layer,Communicational,Sequential,Procedural,Temporal,设计目标:模块内各动作的内聚度越高越好。,9,Coupling(耦合度),Conventional view:,The degree to which,a module is connected to other modules,and to the external world,OO view:,a qualitative measure of the degree to which classes are connected to one another,Level of coupling(耦合度依次递减),Content,Common,Control,Data,Routine call,External,设计目标:模块之间的耦合度越底越好。,10,Component Level Design-I,Step 1.Identify all,design classes,that correspond to the,problem domain,.,Step 2.Identify all,design classes,that correspond to the,infrastructure,domain,.(for example,GUI,component,OS components),Step 3.Elaborate all design classes that are not acquired as reusable components,including,the,message,interface,attribute and operation,.,Step 3a.Specify,message details,when classes,or component,collaborate.(Collaboration,Diagram with messages is shown),11,Component Level Design-I,Step 3b.Identify appropriate,interfaces,for each component,.,下图为PrintJob重构类和接口定义,Step 3c.Elaborate,attributes,and define data types and data structures required to implement them.,12,Component-Level Design-II,Step 3d.,Describe,processing flow within each operation,in detail,.,实例:右图为ComputePaperCost()操作的Activity Diagram.,13,Component-Level Design-III,Step 4.Describe,data sources,(database)and identify the,classes required to manage them.,Step 5.Develop and elaborate,behavioral representations,for a class or component.(右图为PrintJob类的State Chart),Step 6.Elaborate,deployment diagrams,to provide additional implementation detail.,14,Algorithm Design Model,represents the algorithm at a level of detail that can be reviewed for quality,options:,decision table/tree,graphical,(e.g.flowchart,box diagram),PAD,(Program Analysis Diagram),pseudocode,(e.g.PDL),15,Decision Table,10/7/2024,16,Flowchart,17,NS(Box)Diagram,18,Program Analysis Diagram(PAD),19,Program Analysis Diagram(PAD),例:模块binary(x,v,n,p)完成判断一个特定值x是否出现在已经按递增顺序排好序的数组v中。如果存在则返回相应下标,mid,,否则返回值-1。,20,Program Design Language(PDL),10/7/2024,21,Program Design Language(PDL),22,Stepwise Refinement,open,walk to door;,reach for knob;,open door;,walk through;,close door.,repeat until door opens,turn knob clockwise;,if knob doesnt turn,then,take key out;,find correct key;,insert in lock;,endif,pull/push door,move out of way;,end repeat,23,Designing Conventional Components,The design of,processing logic,is governed by the basic principles of algorithm design and structured programming,The design of
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 课件教案


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!