




已阅读5页,还剩25页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1,Chapter 8,Design Concepts,Software Engineering: A Practitioners Approach, 7/e by Roger S. Pressman,2,Design,Good software design should exhibit: Firmness(稳定性): A program should not have any bugs that inhibit its function. Commodity(适用性): A program should be suitable for the purposes for which it was intended. Delight(令人愉快): The experience of using the program should be pleasurable one.,3,Analysis Model = Design Model,4,3 Characters of Design Quality,the design must implement all of the explicit(明确的) requirements contained in the analysis model, and it must accommodate all of the implicit(隐含的) requirements desired by the customer. the design must be a readable, understandable guide for those who generate code and for those who test and subsequently support the software. the design should provide a complete picture(全貌) of the software, addressing the data, functional, and behavioral domains from an implementation perspective.,5,Quality Guidelines,A design should exhibit an architecture that (1) has been created using recognizable architectural styles or patterns, (2) is composed of components that exhibit good design characteristics and (3) can be implemented in an evolutionary fashion A design should be modular; that is, the software should be logically partitioned into elements or subsystems A design should contain representations of data, architecture, interfaces, and components. A design should lead to data structures that are appropriate for the classes to be implemented. A design should lead to components that exhibit independent functional characteristics. A design should lead to interfaces that reduce the complexity of connections between components and with the external environment. A design should be derived using a repeatable method that is driven by information obtained during software requirements analysis. A design should be represented using a notation that effectively communicates its meaning.,6,Design Principles,The design should be traceable to the analysis model. The design should not reinvent(彻底改造) the wheel. The design should “minimize the distance” between the software and the problem as it exists in the real world. The design should exhibit uniformity and integration. The design should be structured to accommodate change. The design should be assessed for quality as it is being created, not after the fact. The design should be reviewed to minimize conceptual (semantic) errors. Design is not coding, coding is not design.,From Davis DAV95,7,Fundamental Concepts,Abstractiondata, procedure Architecture(架构)the overall structure of the software Patternsconveys(承载) the essence(精髓) of a proven design solution Modularitycompartmentalization(划分) of data and function Information hidingcontrolled interfaces Functional independencesingle-minded function and low coupling Aspectsa mechanism for understanding how global requirements affect design Refactoring(重构)a reorganization technique that simplifies the design Design Classesprovide design detail that will enable analysis classes to be implemented,8,Data Abstraction,9,Procedural Abstraction,10,Architecture,“The overall structure of the software and the ways in which that structure provides conceptual integrity for a system.”,Structural properties. This aspect of the architectural design representation defines the components of a system (e.g., modules, objects) and the manner in which those components are packaged and interact with one another. For example, objects encapsulate both data and the processing that manipulates the data. Extra-functional properties. The architectural design description should address how the design architecture achieves requirements for performance, capacity, reliability, security, adaptability, and other system characteristics. Families(族) of related systems. The architectural design should draw upon repeatable patterns that are commonly encountered in the design of families of similar systems. The design should have the ability to reuse architectural building blocks.,11,Architecture,In the simplest form, architecture is the structure or organization of program components(modules), the manner in which these components interact, and the structure of data that are used by the components. In a broader sense, components can be generalized to represent major system elements and their interactions.,12,Modularity,“modularity is the single attribute of software that allows a program to be intellectually manageable“. Monolithic(整块庞大的) software (i.e., a large program composed of a single module) cannot be easily grasped() by a software engineer. The number of control paths, span of reference(引用跨度) , number of variables, and overall complexity would make understanding close to impossible. In almost all instances, you should break the design into many modules, hoping to make understanding easier and as a consequence, reduce the cost required to build the software.,13,Modularity: number of modules,14,Why Information Hiding?,reduces the likelihood of “side effects” limits the global impact of local design decisions emphasizes communication through interfaces discourages the use of global data leads to encapsulationan attribute of high quality design results in higher quality software,15,Information Hiding,16,Sizing Modules: Two Views,17,Functional Independence,Functional independence is achieved by developing modules with “single-minded“ function and an “aversion“ to excessive interaction with other modules. Cohesion(内聚性) is an indication of the relative functional strength of a module. A cohesive module performs a single task, requiring little interaction with other components in other parts of a program. Stated simply, a cohesive module should (ideally) do just one thing. Coupling(耦合性) is an indication of the relative interdependence among modules. Coupling depends on the interface complexity between modules, the point at which entry or reference is made to a module, and what data pass across the interface.,18,Aspect,An aspect is a representation of a cross-cutting concern. (横切关注点: 利用“横切”技术,剖开封装的对象内部,将那些影响多个类的公共行为封装成一个可重用对象,称为Aspect)。 Consider two requirements A and B. B crosscuts A if a software decomposition has been chosen in which A cannot be satisfied without taking B. AOP(Aspect Oriented Programming)是OOP的补充和完善。 如:业务处理的主要流程是核心关注点,与之关系不大的部分是横切关注点, 如权限认证、日志、事务处理等,可以将核心关注点和横切关注点分离开来。,19,显示更新的需求:无论图元何时移动、移动到哪里,都要通知屏幕管理器(Display)其位置发生了改变。,Aspect - Example,20,采用OOP,典型做法是在每个移动图元的操作代码中,插入一段通知Display其位置发生改变的代码,即:调用Display.update( )。,Class Line private Point _p1,_p2; Point getP1( ) return _p1; Point getP2( ) return _p2; void setP1(Point p1) this._p1=p1; Display.update( ); void setP2(Point p2) this._p2=p2; Display.update( ); ,Class Point private int _x1,_x2; int getX( ) return _x1; int getY( ) return _x2; void setX (int x1) this._x1=x1; Display.update( ); void setY(int x2) this._x2=x2; Display.update( ); ,Aspect - Example,21,Aspect DisplayUpdating Pointcut move(): call(void Line.setP1(Point)| call(void Line.setP2(Point)| call(void Point.setX(int)| call(void Point.setY(int); after() returning:move() Display.update(); ,Class Line private Point _p1,_p2; Point getP1( ) return _p1; Point getP2( ) return _p2; void setP1(Point p1) this._p1=p1; void setP2(Point p2) this._p2=p2; Class Point private int _x1,_x2; int getX( ) return _x1; int getY( ) return _x2; void setX (int x1) this._x1=x1; void setY(int x2) this._x2=x2; ,采用AOP,典型做法是在将所有移动图元的代码封装成一个Aspect: DisplayUpdating 。,Aspect - Example,22,AspectAn Example,Consider two requirements for the SafeHomeA WebApp. Requirement A is described via the use-case Access camera surveillance via the Internet. A design refinement would focus on those modules that would enable a registered user to access video from cameras placed throughout a space. Requirement B is a generic security requirement that states that a registered user must be validated prior to using SafeHomeA. This requirement is applicable for all functions that are available to registered SafeHome users. As design refinement occurs, A* is a design representation for requirement A and B* is a design representation for requirement B. Therefore, A* and B* are representations of concerns, and B* cross-cuts A*. An aspect is a representation of a cross-cutting concern. Therefore, the design representation, B*, of the requirement, a registered user must be validated prior to using SafeHomeA, is an aspect of the SafeHome WebApp.,23,Refactoring,Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code design yet improves its internal structure. When software is refactored, the existing design is examined for redundancy unused design elements inefficient or unnecessary algorithms poorly constructed or inappropriate data structures any other design failure that can be corrected to yield a better design.,24,The Design Model,25,Design Model Elements,Data elements Data model data structures Data model database architecture Architectural elements Application domain Analysis classes, their relationships, collaborations and behaviors are transformed into design realizations Interface elements Component elements Deployment elements,26,Architectural Elements,The architectura
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年护理礼仪有题库及答案么
- (正式版)DB65∕T 071-2024 《葡萄平茬嫁接技术规程》
- 音乐实践活动试卷及答案
- 2025年上册数学试卷答案及答案
- 绿色经纪在影视市场中的影响-洞察及研究
- 摄影服务行业法规现状与趋势分析-洞察及研究
- 地下水污染的地球化学解析-洞察及研究
- 多模态生物力学在骨性联结中的应用-洞察及研究
- 五年级信息技术上册 第5课 修饰课程表说课稿 闽教版
- 6.1.1立体图形与平面图形( 第2课时)说课稿人教版数学七年级上册
- 新版中华民族共同体概论课件第六讲“五胡入华”与中华民族大交融(魏晋南北朝时期)-2025年版
- 六堡茶课件教学课件
- 材料作文“交流登山成功的经验”(2024年河南省中考满分作文9篇附审题指导)
- 2025年镇江市中考英语试题卷(含答案)
- 航海船舶因应气象预报方案
- 铝合金介绍教学课件
- 电气班组安全教育培训课件
- 《2025同上一堂思政课》观后感10篇
- SY4201.2-2019石油天然气建设工程施工质量验收规范设备安装塔类检验批表格
- 电机的工作原理课件
- 教育创新战略华润如何打造未来领袖孵化器
评论
0/150
提交评论