




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、面向?qū)ο蟮姆治雠c設(shè)計(jì)簡介ooa & ood: an introduction2021-11-6institute of computer softwarenanjing university1摘要引言如何發(fā)現(xiàn)“類”如何設(shè)計(jì)“類”小結(jié)2021-11-6institute of computer softwarenanjing university2摘要引言引言如何發(fā)現(xiàn)“類”如何設(shè)計(jì)“類”小結(jié)2021-11-6institute of computer softwarenanjing university3面向?qū)ο筌浖こ?021-11-6institute of computer sof
2、twarenanjing university4問題域問題域需求分析需求分析總體設(shè)計(jì)總體設(shè)計(jì)詳細(xì)設(shè)計(jì)詳細(xì)設(shè)計(jì)計(jì)算機(jī)計(jì)算機(jī)ootoopoodooa問題域問題域編程編程測試測試計(jì)算機(jī)計(jì)算機(jī)自然語言自然語言自然語言自然語言分析與設(shè)計(jì)的鴻溝分析與設(shè)計(jì)的鴻溝編程語言編程語言自然語言自然語言面向?qū)ο蟮木幊陶Z言面向?qū)ο蟮木幊陶Z言傳統(tǒng)的軟件工程方法傳統(tǒng)的軟件工程方法面向?qū)ο蟮能浖こ谭椒嫦驅(qū)ο蟮能浖こ谭椒嫦驅(qū)ο筌浖こ堂嫦驅(qū)ο蠓椒ㄕ嬲饬x深遠(yuǎn)的目標(biāo)是它適合于解決分析與設(shè)計(jì)期間的復(fù)雜性并實(shí)現(xiàn)分析與設(shè)計(jì)的復(fù)用。面向?qū)ο蟮拈_發(fā)不僅僅是編程,必須在整個軟件生命周期采用一種全新的方法:在軟件開發(fā)過程所有階段都運(yùn)用
3、面向?qū)ο蟮姆椒ǎ瑢oa,ood,oop,oot有機(jī)地集成在一起,這樣有利于系統(tǒng)的穩(wěn)定性。2021-11-6institute of computer softwarenanjing university5面向?qū)ο筌浖こ虈娙P鸵杂脩粜枨鬄閯恿?,以對象為?qū)動各階段是相互迭代和無間隙的使用相同的描述方法和模型,使得軟件生存期各階段所使用的方法、技術(shù)具有高度的連續(xù)性。2021-11-6institute of computer softwarenanjing university62021-11-6institute of computer softwarenanjing university7
4、面向?qū)ο蠓椒╞oochcoad/yourdonomt:對象模型,功能模型,動態(tài)模型jacobsonumll三種基本活動三種基本活動l識別類和對象識別類和對象l描述對象和類之間描述對象和類之間的關(guān)系的關(guān)系l通過描述每個類的通過描述每個類的功能定義對象的行功能定義對象的行為為面向?qū)ο蠓椒╮ational unified process (rup) rational統(tǒng)一開發(fā)過程迭代式的增量開發(fā)用例驅(qū)動以軟件體系結(jié)構(gòu)為核心2021-11-6institute of computer softwarenanjing university8面向?qū)ο蟮姆治雠c設(shè)計(jì)oo方法強(qiáng)調(diào)開發(fā)過程的連續(xù)性構(gòu)造一系列不斷精化
5、的面向?qū)ο蟮哪P蜆?gòu)造一系列不斷精化的面向?qū)ο蟮哪P蛯?shí)際上目前大多傾向于采用迭代式開發(fā)類成為分析、設(shè)計(jì)和實(shí)現(xiàn)的基本單元類成為分析、設(shè)計(jì)和實(shí)現(xiàn)的基本單元核心問題:how to find the classes (不同層面的類)?how to design the classes?2021-11-6institute of computer softwarenanjing university9推薦craiglarman: applying uml and patterns: an introduction to object-oriented analysis and design and ite
6、rative development 2021-11-6institute of computer softwarenanjing university10面向?qū)ο蠓治鰋oa是軟件開發(fā)過程中的問題定義階段領(lǐng)域分析(domain analysis):抽取和整理用戶需求并建立問題域精確模型的過程。以公共對象、類和框架等形式在特定應(yīng)用領(lǐng)域中標(biāo)識、分析和規(guī)約公共的可復(fù)用的軟件成分的能力。抽象出目標(biāo)系統(tǒng)的本質(zhì)屬性,建立問題領(lǐng)域模型。應(yīng)用分析(application analysis):將領(lǐng)域分析建立起來的問題領(lǐng)域模型,用某種基于計(jì)算機(jī)系統(tǒng)的語言來表示。響應(yīng)時間需求、用戶界面需求和數(shù)據(jù)安全等特殊的需求也都
7、在這一層分解抽出。2021-11-6institute of computer softwarenanjing university11面向?qū)ο蠓治鲱I(lǐng)域分析2021-11-6institute of computer softwarenanjing university12領(lǐng)域領(lǐng)域知識知識源源領(lǐng)域領(lǐng)域分析分析模型模型領(lǐng)域領(lǐng)域分析分析技術(shù)文件技術(shù)文件專家建議專家建議已有應(yīng)用已有應(yīng)用客戶考察客戶考察目前目前/未來的需未來的需求求類的分類類的分類復(fù)用標(biāo)準(zhǔn)復(fù)用標(biāo)準(zhǔn)功能模型功能模型領(lǐng)域語言領(lǐng)域語言2021-11-6institute of computer softwarenanjing univers
8、ity13面向?qū)ο蠓治鼍唧w步驟2021-11-6institute of computer softwarenanjing university14獲取用戶基本需求獲取用戶基本需求標(biāo)識類和對象標(biāo)識類和對象定義類的結(jié)構(gòu)和層定義類的結(jié)構(gòu)和層次次表示類(對象)間表示類(對象)間的關(guān)系的關(guān)系為對象行為建模為對象行為建模常用用例來收集和描述用常用用例來收集和描述用戶的需求戶的需求標(biāo)識類及類的屬性和服務(wù)標(biāo)識類及類的屬性和服務(wù)描述系統(tǒng)的靜態(tài)結(jié)構(gòu)描述系統(tǒng)的靜態(tài)結(jié)構(gòu)描述系統(tǒng)的動態(tài)行為描述系統(tǒng)的動態(tài)行為2021/11/6institute of computer softwarenanjing universit
9、y15需求分析waterfall式開發(fā)其需求分析一開始(其實(shí)是過早地)確定的式開發(fā)其需求分析一開始(其實(shí)是過早地)確定的features 在最終產(chǎn)品中真正采用情況的比例在最終產(chǎn)品中真正采用情況的比例requirement checklistfurps+functionalfeatures, capabilities, securityusabilityhuman factors, help, documentationreliabilityfrequency of failure, recoverability, predictabilityperformanceresponse times,
10、 throughput, accuracy, availability, resource usage.supportability adaptability, maintainability, internationalization, configurability.“+”implementation interface operations packaging legal 2021-11-6institute of computer softwarenanjing university16classificationfunctional requirements: behavior, f
11、eatures, capabilities,securityusability requirements: human factors, help, documentation“the font on the display should be readable from 5 feet”2021-11-6institute of computer softwarenanjing university17classificationreliability requirements: frequency of failure, recoverabilityperformance requireme
12、nts: response times, throughput, accuracy, availability, resource usage, etc.2021-11-6institute of computer softwarenanjing university18classificationsupportability requirements: adaptability, internationalization, maintainability“the system should allow frequent and easy changes in the network conf
13、iguration”the + in the furps+: implementation requirements: “must use linux and java”2021-11-6institute of computer softwarenanjing university19面向?qū)ο蠓治鰋oa模型2021-11-6institute of computer softwarenanjing university20基本模型(類圖)基本模型(類圖)對象層對象層特征層特征層關(guān)系層關(guān)系層交交互互圖圖主主題題圖圖詳細(xì)說明詳細(xì)說明面向?qū)ο笤O(shè)計(jì)ood是面向?qū)ο蠓椒ㄔ谲浖O(shè)計(jì)階段應(yīng)用與擴(kuò)展的結(jié)果,
14、通常分為兩個階段高層設(shè)計(jì):建立應(yīng)用的體系結(jié)構(gòu)低層設(shè)計(jì):集中于類的詳細(xì)設(shè)計(jì)ood的準(zhǔn)則抽象,信息隱藏,模塊化,弱耦合,強(qiáng)內(nèi)聚,可重用2021-11-6institute of computer softwarenanjing university21面向?qū)ο笤O(shè)計(jì)ood具體內(nèi)容按實(shí)現(xiàn)條件對ooa模型進(jìn)行調(diào)整,并補(bǔ)充幾個新的組成部分:設(shè)計(jì)問題域組元設(shè)計(jì)人機(jī)交互組元設(shè)計(jì)任務(wù)管理組元設(shè)計(jì)數(shù)據(jù)管理組元2021-11-6institute of computer softwarenanjing university22摘要引言如何發(fā)現(xiàn)如何發(fā)現(xiàn)“類類”如何設(shè)計(jì)“類”小結(jié)2021-11-6institute o
15、f computer softwarenanjing university23回顧:三個世界three worldsvisual modeling2021-11-6institute of computer softwarenanjing university242021-11-6institute of computer softwarenanjing university25現(xiàn)實(shí)世界現(xiàn)實(shí)世界問題世界問題世界軟件世界軟件世界reality抽象抽象問題:how to find the classes?use case基于需求文檔use-case model: writing requireme
16、nts in context2021-11-6institute of computer softwarenanjing university26用例(use cases)用例是一個敘述性文檔,用來描述參與者使用系統(tǒng)完成某個過程時的事件發(fā)生順序。用例乃是對過程的描述。過程描述事件、動作和事務(wù)處理自始至終的發(fā)生順序。use cases are text documents, not diagrams, and use-case modeling is primarily an act of writing text, not drawing diagrams.2021-11-6institute
17、 of computer softwarenanjing university27use case例子:process sale: a customer arrives at a checkout with items to purchase. the cashier uses the pos system to record each purchased item. the system presents a running total and line-item details. the customer enters payment information, which the syst
18、em validates and records. the system updates inventory. the customer receives a receipt from the system and then leaves with the items.2021-11-6institute of computer softwarenanjing university28actor, scenario, use case簡單地說,an actor is something with behavior, such as a person (identified by role),
19、computer system, or organization; for example, a cashier.a scenario is a specific sequence of actions and interactions between actors and the system; it is also called a use case instance. it is one particular story of using a system, or one path through the use case; for example, the scenario of su
20、ccessfully purchasing items with cash, or the scenario of failing to purchase items because of a credit payment denial.a use case is a collection of related success and failure scenarios that describe an actor using a system to support a goal. for example, here is a casual format use case with alter
21、nate scenarios:2021-11-6institute of computer softwarenanjing university29process sale2021-11-6institute of computer softwarenanjing university302021-11-6institute of computer softwarenanjing university31actor有g(shù)oalivar jacobson: a set of use-case instances, where each instance is a sequence of actio
22、ns a system performs that yields an observable result of value to a particular actor.軟件工程師容易犯的錯誤:自認(rèn)為所做的是客戶/用戶需要的。不能代替客戶/用戶假想其價(jià)值所在。2021-11-6institute of computer softwarenanjing university32創(chuàng)建use case的一些原則用例可以是一個場景,包括動作和交互。用例可以是一組場景,描述不同場景下的行為。這種書寫格式可以在任何時候描述有變體的行為,例如黑盒需求,業(yè)務(wù)流程,系統(tǒng)設(shè)計(jì)說明。 用例里不要有系統(tǒng)設(shè)計(jì),用例里不
23、要有界面設(shè)計(jì),用例里不要有特性列表,用例里不要有測試。用例應(yīng)該描述行為需求。用例的主場景不要超過九步??梢栽谶m當(dāng)?shù)膶哟紊系玫阶幽繕?biāo)和移除設(shè)計(jì)說明。用例的最大價(jià)值不在于主場景,而是在于備選行為。主場景可能只占用例長度的四分之一到十分之一。2021-11-6institute of computer softwarenanjing university33用例的識別界定系統(tǒng)邊界基于參與者先識別參與者對每個參與者,找出其所發(fā)起和參與的過程基于事件識別系統(tǒng)必須響應(yīng)的外部事件把事件與參與者和用例聯(lián)系起來2021-11-6institute of computer softwarenanjing univ
24、ersity34邊界,actors,goals2021-11-6institute of computer softwarenanjing university35識別actors及其goals除了明顯的actors之外,還要問問諸如以下這些問題:who starts and stops the system?who does system administration?who does user and security management?is time an actor because the system does something in response to a time ev
25、ent?is there a monitoring process that restarts the system if it fails?who evaluates system activity or performance?how are software updates handled? push or pull update?who evaluates logs? are they remotely retrieved?in addition to human primary actors, are there any external software or robotic sy
26、stems that call upon services of the system?who gets notified when there are errors or failures?36use cases favor a functional approach!“also, name use cases starting with a verb.”not very useful in finding classes.but, useful in understanding requirements, validating the resulted model and implemen
27、tation.此外還要對照furps+檢查其他需求2021-11-6institute of computer softwarenanjing university37find the classes“the nouns and the verbs”啟發(fā):類與方法;但是“the elevator will close its door before it moves to another floor.”有的名詞不是類;有的類不表現(xiàn)為名詞;基本原則:adt2021-11-6institute of computer softwarenanjing university38find the cla
28、sses沒有機(jī)械的辦法?;诮?jīng)驗(yàn)的啟發(fā)性、指導(dǎo)性的原則:哪些東西是可能的類;哪些形式的類不理想,可考慮從模型中去除;2021-11-6institute of computer softwarenanjing university39the ideal class明確的抽象類名是名詞或形容詞,刻畫該抽象形容詞 常用于 表達(dá)接口代表一系列運(yùn)行時刻的對象。(允許特意的singleton)有修改操作(或作用式操作)形式或非形式地刻畫性質(zhì):不變式 前后置斷言2021-11-6institute of computer softwarenanjing university40三種 類分析類直接對應(yīng)于問題
29、域設(shè)計(jì)類為得到優(yōu)雅的、可擴(kuò)展的結(jié)構(gòu)而引入實(shí)現(xiàn)類滿足軟件系統(tǒng)實(shí)現(xiàn)算法所需。如linkedlist; array等2021-11-6institute of computer softwarenanjing university41分析類analysis classes represent an early conceptual model for things in the system which have responsibilities and behavior.analysis classes are used to capture a first-draft, rough-cut of
30、 the object model of the system.analysis classes handle primarily functional requirements. they model objects from the problem domain. 2021-11-6institute of computer softwarenanjing university42分析類there are three aspects of the system that are likely to change: the boundary between the system and it
31、s actors (boundary)the information the system uses (entity)the control logic of the system (control)2021-11-6institute of computer softwarenanjing university43behaviourinformationboundaryheuristics for finding classes尋找分析類operational model of some aspect of the external world.simulationbut external
32、classes can be quite abstract 不一定是客觀實(shí)體,也可能是抽象概念2021-11-6institute of computer softwarenanjing university44heuristics for finding classes尋找實(shí)現(xiàn)類實(shí)現(xiàn)難多復(fù)用數(shù)據(jù)結(jié)構(gòu)與算法知識延遲實(shí)現(xiàn)類如“queue” 類層次 組織 多種不同實(shí)現(xiàn)2021-11-6institute of computer softwarenanjing university45heuristics for finding classes尋找設(shè)計(jì)類創(chuàng)造性工作設(shè)計(jì)模式的用武之地其他途徑舊系統(tǒng)ad
33、aptation through inheritance 2021-11-6institute of computer softwarenanjing university462021-11-6institute of computer softwarenanjing university472021-11-6institute of computer softwarenanjing university482021-11-6institute of computer softwarenanjing university492021-11-6institute of computer soft
34、warenanjing university50domain model 領(lǐng)域模型a domain model is a representation of real-world conceptual classes not a representation of software components. not a set of diagrams describing software classes, not software objects with responsibilities.a domain model is a visual representation of concept
35、ual classes or real-world objects in a domain of interest mo95, fowler96they have also been called conceptual models, domain object models, and analysis object modelsthe up defines a domain model as one of the artifacts that may be created in the business modeling discipline.2021-11-6institute of co
36、mputer softwarenanjing university51domain modelusing uml notation, a domain model is illustrated with a set of class diagrams in which no operations are defined. it may show:domain objects or conceptual classesassociations between conceptual classesattributes of conceptual classes2021-11-6institute
37、of computer softwarenanjing university52 informally, a conceptual class is an idea, thing, or object. more formally, a conceptual class may be considered in terms of its symbol, intension, and extensionmo95.domain model2021-11-6institute of computer softwarenanjing university53domain modelsoftware p
38、roblems can be complex;decomposition (divide-and-conquer) is a common strategy to deal with this complexity by division of the problem space into comprehensible units. in structured analysis, the dimension of decomposition is by processes or functions. however, in object-oriented analysis, the dimen
39、sion of decomposition is fundamentally by things or entities in the domain.a central distinction between object-oriented and structured analysis is: division by conceptual classes (objects) rather than division by functions.a primary analysis task is to identify different concepts in the problem dom
40、ain and document the results in a domain model2021-11-6institute of computer softwarenanjing university54system sequence diagrams識別系統(tǒng)事件定義系統(tǒng)操作給出這些操作的contracts2021-11-6institute of computer softwarenanjing university552021-11-6institute of computer softwarenanjing university57contract co2: enteritemop
41、eration:cross references:preconditions:postconditions:enteritem(itemid: itemid, quantity: integer)use cases: process salethere is a sale underway.- a saleslineitem instance sli was created (instance creation).- sli was associated with the current sale (association formed).- sli.quantity became quantity (attribute modification).- sli was associated with a productdesc
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年色素素庫緞行業(yè)深度研究分析報(bào)告
- 2022-2027年中國汽車活塞行業(yè)市場發(fā)展現(xiàn)狀及投資前景展望報(bào)告
- 中國膠合板設(shè)備行業(yè)發(fā)展前景預(yù)測及投資戰(zhàn)略咨詢報(bào)告
- 采暖換熱站補(bǔ)水泵頻繁啟動檢查報(bào)告
- 2024-2030年中國北京酒店行業(yè)發(fā)展監(jiān)測及投資前景展望報(bào)告
- 企業(yè)展廳立項(xiàng)報(bào)告模板
- 2025年中國無油渦旋真空泵行業(yè)發(fā)展運(yùn)行現(xiàn)狀及發(fā)展趨勢預(yù)測報(bào)告
- 鈷鉆行業(yè)市場發(fā)展及發(fā)展趨勢與投資戰(zhàn)略研究報(bào)告
- 中國高壓直流輸電系統(tǒng)(HVDC系統(tǒng))行業(yè)市場發(fā)展監(jiān)測及投資戰(zhàn)略規(guī)劃報(bào)告
- 2025年中國粒料干燥器行業(yè)市場深度分析及投資戰(zhàn)略規(guī)劃報(bào)告
- 2024年知識競賽-《民用爆炸物品安全管理?xiàng)l例》知識競賽筆試參考題庫含答案
- 出師表(選擇題)答案版
- (正式版)JBT 9229-2024 剪叉式升降工作平臺
- (高清版)DZT 0208-2020 礦產(chǎn)地質(zhì)勘查規(guī)范 金屬砂礦類
- (高清版)DZT 0368-2021 巖礦石標(biāo)本物性測量技術(shù)規(guī)程
- 礦山開采與環(huán)境保護(hù)
- 企業(yè)事業(yè)部制的管理與監(jiān)督機(jī)制
- 兒童體液平衡及液體療法課件
- 勞動防護(hù)用品培訓(xùn)試卷帶答案
- ORACLE執(zhí)行計(jì)劃和SQL調(diào)優(yōu)
- 2024年鐘山職業(yè)技術(shù)學(xué)院高職單招(英語/數(shù)學(xué)/語文)筆試歷年參考題庫含答案解析
評論
0/150
提交評論