版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(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è)類的公共行為封裝成一個(gè)可重用對(duì)象,稱為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)益歸上傳用戶所有。
- 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ì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 激光測(cè)距計(jì)儀表采購(gòu)合同范本
- 設(shè)備采購(gòu)與安裝協(xié)議
- 苗木采購(gòu)合同格式范文
- 家具選購(gòu)合同全解析策略
- 高利貸借款合同書(shū)樣本格式
- 投資合同協(xié)議撰寫(xiě)
- 酒店用品供應(yīng)商采購(gòu)協(xié)議
- 機(jī)械設(shè)備采購(gòu)合同格式模板
- 房屋地基買(mǎi)賣(mài)合同模版
- 設(shè)計(jì)印刷服務(wù)合同協(xié)議書(shū)
- 電動(dòng)力學(xué)-選擇題填空題判斷題和問(wèn)答題2018
- 重慶財(cái)經(jīng)學(xué)院《自然語(yǔ)言處理》2022-2023學(xué)年第一學(xué)期期末試卷
- 【MOOC】大學(xué)生職業(yè)發(fā)展與就業(yè)指導(dǎo)-河南科技大學(xué) 中國(guó)大學(xué)慕課MOOC答案
- 2024年度總結(jié)暨表彰大會(huì)議程例文(3篇)
- 山東省濟(jì)南市2023-2024學(xué)年高二上學(xué)期期末考試地理試題 附答案
- 【MOOC】微型計(jì)算機(jī)原理與接口技術(shù)-南京郵電大學(xué) 中國(guó)大學(xué)慕課MOOC答案
- 人人愛(ài)設(shè)計(jì)學(xué)習(xí)通超星期末考試答案章節(jié)答案2024年
- 銅材壓延生產(chǎn)節(jié)能減排關(guān)鍵技術(shù)研究
- 500字作文標(biāo)準(zhǔn)稿紙A4打印模板-直接打印
- 福建省廈門(mén)市翔安區(qū)2023-2024學(xué)年八年級(jí)上學(xué)期期末語(yǔ)文試題
- 國(guó)開(kāi)電大軟件工程形考作業(yè)3參考答案
評(píng)論
0/150
提交評(píng)論