软件工程Ch11.ppt
《软件工程Ch11.ppt》由会员分享,可在线阅读,更多相关《软件工程Ch11.ppt(24页珍藏版)》请在课桌文档上搜索。
1、1,Chapter 11Component-Level Design(构件设计),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(面向
2、对象观点):a component contains a set of collaborating(协作)classesConventional view(常规观点):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
3、Component,4,Conventional Component,5,Basic Design Principles,The Open-Closed Principle(OCP).“A module component should be open for extension but closed for modification.(对外可扩展,对内不修改)The Liskov Substitution Principle(LSP).“Subclasses should be substitutable for their base classes.(子类能代替基类)Dependency
4、Inversion Principle(DIP).“Depend on abstractions.Do not depend on concretions.”(依赖抽象,不依赖具体)The Interface Segregation Principle(ISP).“Many client-specific interfaces are better than one general purpose interface.(对某些客户专用的界面比通用界面好)The Release Reuse Equivalency Principle(REP).“The granule of reuse is t
5、he granule of release.”(复用的粒度就是发布的粒度)The Common Closure Principle(CCP).“Classes that change together belong together.”(共同封原则:一同变更的类应该打包在一起)The Common Reuse Principle(CRP).“Classes that arent reused together should not be grouped together.”(共同利用原则:不一起利用的类不放在一个分组内),6,Design Guidelines,ComponentsNaming
6、 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 we
7、ll as helping us to achieve the OPC)接口提供关于通讯和协作的重要信息,7,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 and to the class or component itselfLe
8、vels of cohesionFunctional(功能性)Layer(层)Communicational(通讯)Sequential(顺序)Procedural(过程)Temporal(暂时)Utility(实用),These courseware materials are to be used in conjunction with Software Engineering:A Practitioners Approach,6/e and are provided with permission by R.S.Pressman&Associates,Inc.,copyright 199
9、6,2001,2005,8,Coupling(耦合),Conventional view:The degree(程度)to which a component is connected to other components and to the external worldOO view:a qualitative(定性的)measure of the degree to which classes are connected to one anotherLevel of couplingContent(内容)Common(共用)Control(控制)Stamp(印记)Data(数据)Rou
10、tine call(例程调用)Type use(类型使用)Inclusion or import(包含或导入)External(外部),These courseware materials are to be used in conjunction with Software Engineering:A Practitioners Approach,6/e and are provided with permission by R.S.Pressman&Associates,Inc.,copyright 1996,2001,2005,9,Component Level Design-I,Ste
11、p 1.Identify all design classes that correspond to the problem domain.Step 2.Identify all design classes that correspond to the infrastructure domain.Step 3.Elaborate all design classes that are not acquired as reusable components.Step 3a.Specify message details when classes or component collaborate
12、.Step 3b.Identify appropriate interfaces for each component.,These courseware materials are to be used in conjunction with Software Engineering:A Practitioners Approach,6/e and are provided with permission by R.S.Pressman&Associates,Inc.,copyright 1996,2001,2005,10,Component-Level Design-II,Step 3c.
13、Elaborate attributes and define data types and data structures required to implement them.Step 3d.Describe processing flow within each operation in detail.Step 4.Describe persistent data sources(databases and files)and identify the classes required to manage them.Step 5.Develop and elaborate behavio
14、ral representations for a class or component.Step 6.Elaborate deployment diagrams to provide additional implementation detail.Step 7.Factor every component-level design representation and always consider alternatives.,These courseware materials are to be used in conjunction with Software Engineering
15、:A Practitioners Approach,6/e and are provided with permission by R.S.Pressman&Associates,Inc.,copyright 1996,2001,2005,11,Collaboration Diagram,These courseware materials are to be used in conjunction with Software Engineering:A Practitioners Approach,6/e and are provided with permission by R.S.Pre
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 软件工程 Ch11

链接地址:https://www.desk33.com/p-235689.html