版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1Chapter 8Design ConceptsSoftware Engineering: A Practitioners Approach, 7/e by Roger S. Pressman2DesignGood software design should exhibit:Firmness(穩(wěn)定性): A program should not have any bugs that inhibit its function. Commodity(適用性): A program should be suitable for the purposes for which it was inte
2、nded. Delight(令人愉快): The experience of using the program should be pleasurable one.3Analysis Model = Design Model4Three Characters of Design Qualitythe design must implement all of the explicit(明確的) requirements contained in the analysis model, and it must accommodate all of the implicit(隱含的) requir
3、ements 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 a
4、n implementation perspective.5 Design Quality GuidelinesA 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.
5、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 des
6、ign 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 obtai
7、ned during software requirements analysis.A design should be represented using a notation that effectively communicates its meaning.6Design PrinciplesThe design should be traceable to the analysis model. The design should “minimize the distance” between the software and the problem as it exists in t
8、he real world. The design should exhibit 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. Design is not coding, coding is not design. From Davis DAV957Design Fundamental ConceptsAbstractiondata,
9、procedureArchitecture(架構(gòu))the overall structure of the softwarePatternsconveys(承載) the essence(精髓) of a proven design solutionModularitycompartmentalization(劃分) of data and functionInformation hidingcontrolled interfacesFunctional independencesingle-minded function and low couplingAspectsa mechanism
10、for understanding how global requirements affect designRefactoring(重構(gòu))a reorganization technique that simplifies the designDesign Classesprovide design detail that will enable analysis classes to be implemented8Data Abstractiondoorimplemented as a data structuremanufacturermodel numbertypeswing dire
11、ctionweightopening mechanism9Procedural Abstractionopenimplemented with a knowledge of the object that is associated with enterdetails of enter algorithm10Architecture & its Properties“The overall structure of the software and the ways in which that structure provides conceptual integrity for a syst
12、em.”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 manipu
13、lates 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 ar
14、chitectural 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. (即:考慮重用)11ArchitectureIn the simplest form, architecture is the structure or organization of
15、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, architecture can be generalized to represent major system elements and their interactions.12Modularitymodularity is the single attribute of softw
16、are 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
17、 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.13Modularity: number of modules What is the right number of modules for a specific soft
18、ware design?optimal number of modules cost of softwarenumber of modulesmoduleintegrationcostmodule development cost 14Why Information Hiding?reduces the likelihood of “side effects”limits the global impact of local design decisionsemphasizes communication through interfacesdiscourages the use of glo
19、bal dataencapsulationan attribute of high quality designresults in higher quality software15Information Hidingmoduleinterfacesecret algorithm data structure resource allocation policyclientsa specific design decision16Sizing Modules: Two Views17Functional IndependenceFunctional independence is achie
20、ved by developing modules with “single-minded” function and an “aversion(避免) to excessive interaction with other modules.Cohesion(內(nèi)聚性) 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 othe
21、r 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 da
22、ta pass across the interface.18AspectAn aspect is a representation of a cross-cutting concern. (橫切關(guān)注點(diǎn): 利用“橫切”技術(shù),剖開(kāi)封裝的對(duì)象內(nèi)部,將那些影響多個(gè)類(lèi)的公共行為封裝成一個(gè)可重用對(duì)象,稱(chēng)為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. A
23、OP(Aspect Oriented Programming)是OOP的補(bǔ)充和完善。如:業(yè)務(wù)處理的主要流程是核心關(guān)注點(diǎn),與之關(guān)系不大的部分是橫切關(guān)注點(diǎn), 如權(quán)限認(rèn)證、日志、事務(wù)處理等,可以將核心關(guān)注點(diǎn)和橫切關(guān)注點(diǎn)分離開(kāi)來(lái)。19AspectAn ExampleConsider two requirements for the SafeHomeA WebApp. Requirement A is described via the use-case Access camera surveillance via the Internet. A design refinement would focu
24、s 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 avai
25、lable 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.
26、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. 20顯示更新的需求:無(wú)論圖元何時(shí)移動(dòng)、移動(dòng)到哪里,都要通知屏幕管理器(Display)其位置發(fā)生了改變。Aspect - Example21 采用OOP,典型做法是在每個(gè)移動(dòng)圖元的操作代碼中,插入一段通知Display其位置發(fā)生改變的代碼,即:調(diào)用Display.update(
27、 )。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._
28、x1=x1; Display.update( ); void setY(int x2)this._x2=x2; Display.update( ); Aspect - Example22Aspect 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 pr
29、ivate 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,典型做法是在將所有移動(dòng)
30、圖元的代碼封裝成一個(gè)Aspect: DisplayUpdating 。Aspect - Example23RefactoringRefactoring 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. 重構(gòu)是指優(yōu)化軟件的處理過(guò)程和內(nèi)部結(jié)構(gòu)而不改變軟件的外部行為的方法。When software is refactored, th
31、e existing design is examined for redundancyunused design elementsinefficient or unnecessary algorithmspoorly constructed or inappropriate data structuresany other design failure that can be corrected to yield a better design.24The Design Model25Design Model ElementsData elementsData model - data structuresData model - database architectureArchitectural elementsApplication domainAnalysis classes, their relationships, collaborations and behaviors are transformed into design realizationsInterface elementsComponent elementsDeployment elements26Architectural ElementsThe architectura
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年園林景觀照明系統(tǒng)設(shè)計(jì)與安裝合同3篇
- 2024年版新員工勞動(dòng)協(xié)議模板指導(dǎo)樣例版B版
- 音樂(lè)教學(xué)工作計(jì)劃
- 2021后勤工作總結(jié)范文
- 全年工作計(jì)劃集合六篇
- 2021員工辭職報(bào)告集錦15篇
- 公司的活動(dòng)總結(jié)感悟10篇
- 公司技術(shù)員個(gè)人工作總結(jié)例文8篇
- 教導(dǎo)工作計(jì)劃四篇
- 遠(yuǎn)程培訓(xùn)總結(jié)(15篇)
- 北京市海淀區(qū)2021-2022學(xué)年第一學(xué)期四年級(jí)期末考試語(yǔ)文試卷(含答案)
- 外墻用水泥纖維板接縫位置開(kāi)裂問(wèn)題及處理
- 超星爾雅學(xué)習(xí)通【中國(guó)近現(xiàn)代史綱要(首都師范大學(xué))】章節(jié)測(cè)試含答案
- 《鼻負(fù)壓置換術(shù)在兒童呼吸道感染中的應(yīng)用及護(hù)理對(duì)策研究【論文】3600字》
- 發(fā)動(dòng)機(jī)機(jī)械系統(tǒng)2.0升ltg-9.66維修指南車(chē)下
- 哈爾濱市商品房買(mǎi)賣(mài)合同書(shū)(最終定稿)
- 信號(hào)與系統(tǒng) 西安郵電 習(xí)題答案
- 新疆維吾爾自治區(qū)和田地區(qū)各縣區(qū)鄉(xiāng)鎮(zhèn)行政村村莊村名居民村民委員會(huì)明細(xì)及行政區(qū)劃代碼
- 用人單位終止(解除)勞動(dòng)合同證明書(shū)參考
- 天津工業(yè)大學(xué)《工程力學(xué)》2017-2018-1期末試卷及答案
- 能力素質(zhì),勝任力模型
評(píng)論
0/150
提交評(píng)論