nontrivial非平凡的.ppt

上传人:小飞机 文档编号:6513095 上传时间:2023-11-08 格式:PPT 页数:37 大小:369KB
返回 下载 相关 举报
nontrivial非平凡的.ppt_第1页
第1页 / 共37页
nontrivial非平凡的.ppt_第2页
第2页 / 共37页
nontrivial非平凡的.ppt_第3页
第3页 / 共37页
nontrivial非平凡的.ppt_第4页
第4页 / 共37页
nontrivial非平凡的.ppt_第5页
第5页 / 共37页
点击查看更多>>
资源描述

《nontrivial非平凡的.ppt》由会员分享,可在线阅读,更多相关《nontrivial非平凡的.ppt(37页珍藏版)》请在三一办公上搜索。

1、AUTS,1,Software Engineering:A Practitioners Approach,6/eChapter 11Component-Level Design,AUTS,2,ObjectivesTo introduce component design and to explain its importanceTo introduce different views of component To introduce cohesion and coupling and to explain its importanceTo describe a number of diffe

2、rent representation techniques for procedural design and when they may be used,AUTS,3,1.Architecture design to component design2.What is a Component?3.Designing class-based component(Cohesion and Coupling)4.Designing conventional component,AUTS,4,Analysis Model-Design Model,AUTS,5,Componeng-level de

3、sign defines the data structures,algorithms,interface characteristics,and communications mechanisms allocated to each software component.,Architectural design represents the structure of data and program structure of software.,AUTS,6,1.Architecture design to component design2.What is a Component?3.D

4、esigning class-based component(Cohesion and Coupling)4.Designing conventional component,AUTS,7,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 int

5、erfaces.”,a nontrivial(非平凡的),nearly independent,and replaceable part of a system that fulfils a clear function in the context of a well defined architecture-Brown和Wallnau,AUTS,8,OO view:a component contains a set of collaborating classesConventional view:logic,the internal data structures that are r

6、equired to implement the processing logic,and an interface that enables the component to be invoked and data to be passed to it.,AUTS,9,OO Component,collect the customers s requirements at the front counter,cost a print job,and then pass the job on to an antomated production facillity,Analysis class

7、,Design component,AUTS,10,OO Component,细化的设计类,AUTS,11,Conventional view,A Conventional component also called module,resides within the software architecture and serves one of three important roles:1)control component 2)domain component 3)infrastructure coponent,AUTS,12,Structure chart for a conventi

8、onal system,ConventionalComponent,AUTS,13,Conventional Component,细化后的模块,AUTS,14,1.Architecture design to component design2.What is a Component?3.Designing class-based component(Cohesion and Coupling)4.Designing conventional component,AUTS,15,Cohesion(内聚),Conventional view:the“single-mindedness(专诚性)”

9、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 itself,AUTS,16,OO view,Levels of cohesionFunctional(功能内聚)Layer(分层内聚)Communicational(通信内聚)Sequential(顺序内聚)Procedural(过程内聚)Te

10、mporal(暂时内聚)Utility(实用内聚),AUTS,17,Functional(功能内聚)Exhibited primarily by operations,this level of cohesion occurs when a module performs one and only one computation and then returns a result.,AUTS,18,Communicational(通信内聚)All operations that access the same data are defined within one class.In gener

11、al,such classes focus solely on the data in question,accessing and storing it.,AUTS,19,Sequential(顺序内聚)components or operations are grouped in a manner that allows the first to provide to the next and so on.The in tent is to implement a sequence of operations.,AUTS,20,It is important to note,however

12、,that pragmatic design and implementation issues sometimes force a designer to opt for lower levels of cohesion.,AUTS,21,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 class

13、es are connected to one another,AUTS,22,OO view,Level of couplingContent(内容藕合)Common(公共藕合)Control(控制藕合)Stamp(印记藕合)Data(数据藕合)Routine call(例程调用藕合)Type use(类型使用藕合)Inclusion or import(包含和导入藕合)External(外部藕合),AUTS,23,Content(内容藕合)Occurs when one component“”surreptitiously”modifies data that is internal to

14、 another component.,AUTS,24,Common(公共藕合)Occurs when a number of components all make use of a global variable.,AUTS,25,Control(控制藕合)Occurs when operation A()invoke operation B()and passes a control flag to B,这种耦合的实质是在单一接口上选择多功能模块中的某项功能。,AUTS,26,Stamp(印记藕合)Occurs when class B is declared as a type for

15、 an argument of an operation of class A.,AUTS,27,Data(数据藕合)Occurs when operations pass long string of data argument,AUTS,28,Software must communicate internally and externally,Therefore,coupling is a fact of life.However,the designer should work to reduce coupling whenever possible and understand th

16、e ramifications of high coupling when it can not be avoided.,AUTS,29,1.Architecture design to component design2.What is a Component?3.Designing class-based component(Cohesion and Coupling)4.Designing conventional component,AUTS,30,A Structured Procedural Design,AUTS,31,流程图的基本控制结构,AUTS,32,AUTS,33,Dec

17、ision Table判定表,AUTS,34,Program Design Language(PDL)PDL,PROCEDURE spellcheck IS 查找错拼的单词 BEGIN split document into single words 把整个文档分离成单词 lood up words in dictionary 在字典中查这些单词 display words which are not in dictionary显示字典中查不到的单词 create a new dictionary 造一新字典 END spellcheck,AUTS,35,Program Design Lang

18、uage(PDL),AUTS,36,Summary,The component level design action encompasses a sequence of tasks that slowly reduce the level of abstraction with software is represented.Different views of a“component”are introduced.Guidelines for the design of object-oriented and traditional(conventional)program components are presented.Elements of the structured programming and a number of representation techniques for procedural design are reviewed,AUTS,37,Homework(HW8),1.How does the object-oriented view of component-level design differ from the conventional view?2如何理解模块独立性?用什么指标来衡量模块独立性?,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号