




已閱讀5頁,還剩123頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
領(lǐng)域模型概念的可視化,徐迎曉 復(fù)旦大學(xué)軟件學(xué)院,outline,什么是領(lǐng)域模型 概念類 識(shí)別和提取概念類 創(chuàng)建領(lǐng)域模型步驟 幾個(gè)問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,什么是領(lǐng)域模型 概念類 識(shí)別和提取概念類 創(chuàng)建領(lǐng)域模型步驟 幾個(gè)問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,Use cases: important requirements analysis artifact, but are not object-oriented. emphasize a process view of the domain. Domain model The most important artifact to create in OOA,領(lǐng)域模型domain model是概念類或 問題領(lǐng)域中實(shí)際對象的可視化表達(dá),又稱為: 概念模型conceptual models 領(lǐng)域?qū)ο竽P蚫omain object models 分析對象模型analysis object models.,什么是領(lǐng)域模型 概念類 識(shí)別和提取概念類 創(chuàng)建領(lǐng)域模型步驟 幾個(gè)問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,概念模型,領(lǐng)域模型顯示問題領(lǐng)域中對建模者有意義的概念類 OOA中創(chuàng)建的最重要的制品 識(shí)別大量對象或概念類heart of OOA 領(lǐng)域模型表達(dá)的是現(xiàn)實(shí)世界中的概念類,而不是軟件構(gòu)件(不是軟件類或帶有職責(zé)的軟件對象) 識(shí)別概念類是問題域調(diào)查的一部分 UML中的類圖可以顯示領(lǐng)域模型,使用UML表示法,領(lǐng)域模型用一組不帶操作的類圖來表示,可顯示: 領(lǐng)域?qū)ο蠡蚋拍铑?概念類之間的關(guān)聯(lián) 概念類的屬性,可視化字典,領(lǐng)域模型將領(lǐng)域中的單詞、概念類可視化,并將其相互關(guān)聯(lián)(比文字更容易閱讀) 領(lǐng)域模型顯示了視圖或抽象的一部分,而將建模者不感興趣的細(xì)節(jié)忽略。 創(chuàng)建領(lǐng)域模型同時(shí)有助于澄清領(lǐng)域中術(shù)語和詞匯可視化字典,不是軟件設(shè)計(jì),領(lǐng)域模型是現(xiàn)實(shí)世界問題領(lǐng)域中事物的可視化,而不是軟件構(gòu)件的可視化 不是軟件制品如window, database 不帶有職責(zé)和方法,領(lǐng)域模型顯示現(xiàn)實(shí)世界的概念,領(lǐng)域模型避免軟件制品或類,什么是領(lǐng)域模型 概念類 識(shí)別和提取概念類 創(chuàng)建領(lǐng)域模型步驟 幾個(gè)問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,創(chuàng)建領(lǐng)域模型步驟,列出候選概念類 在領(lǐng)域模型中畫出候選概念類 添加關(guān)系 添加屬性,什么是領(lǐng)域模型 概念類 識(shí)別和提取概念類 創(chuàng)建領(lǐng)域模型步驟 幾個(gè)問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,領(lǐng)域模型識(shí)別和提取概念類,用概念類種類列表 識(shí)別名詞短語 使用分析模式,使用概念種類列表,store and airline reservation domains.,饑餓,恐高癥,識(shí)別名詞和名詞短語,it is another source of inspiration. Care: a mechanical noun-to-class mapping isnt possible words in natural languages are ambiguous it is recommended in combination with the Conceptual Class Category List technique.,Some are candidate conceptual classes Some maybe ignored in this iteration (“Accounting“ and “commissions“) Some may be attributes of conceptual classes.(Price),使用分析模式,由專家創(chuàng)建并公開的部分領(lǐng)域模型 Martin Fowler 分析模式:可復(fù)用的對象模型 Analysis Patterns Reusable Object Models Addison Wesley/Pearson 機(jī)械工業(yè)出版社 中國電力出版社(影印版),Martin Fowler的主要精品著作有 重構(gòu)改善既有代碼的設(shè)計(jì)(Refactoring: Improving the Design of Existing Code)、 UML精粹:標(biāo)準(zhǔn)對象建模語言簡明指南(UML Distilled:A Brief Guide to the Standard Object Modeling) 分析模式:可重用的對象模型(Analysis Patterns:Reusable Object Models) 規(guī)劃極限編程(Planning Extreme Programming) 企業(yè)應(yīng)用架構(gòu)模式(Patterns of Enterprise Application Architecture)等,銷售領(lǐng)域候選概念類,POS系統(tǒng)領(lǐng)域模型,Group size,You should preferably be 5-7 persons in the group that identifies concepts. With a group of this size you get several perspectives and ways of thinking. And if the group is larger it can be difficult to agree on the concepts. The group should contain a mixture of persons, e. g. analysts, designers, programmers. There should be at least one domain expert in the group One person is the leader. His/her job is the make the group work dynamically. One should have clear objectives for each meeting! Disputes should be solved harmonically, so it is important that the leader is trusted by everyone.,A process for identifying concepts,1. each person is assigned to search for concepts in different places. 2. the whole group meets and finds concept candidates using brainstorming. All possible concepts should be includes! All concepts are equally important!,3. When no more concepts are found, you have a good starting point for identifying the suitable concepts for the problem area. Divide the concepts into three groups: 1. Concepts which everybody thinks are important 2. Concepts that fall outside the problem area, are more suitable as attributes, concepts with the same meaning etc. 3. Concepts which fall in between these groups. 4. Discuss the concepts in group 3 which not everyone agrees on. These concepts should be treated consistently.,Principles for brainstorming,All ideas are equally important Think quickly, not too much consideration; think more later Let everyone speak (Round-Robin Technique) A good mood can be an important strength,Good concepts,It is important to point out that you probably havent found all appropriate concepts after looking for them the first time, if the problem area isnt very trivial! The more you work with the domain model,the better it gets. It can take several iterations to reach a stable model.,領(lǐng)域模型添加關(guān)聯(lián),從前有座山,山上有座廟,廟里有個(gè),添加關(guān)聯(lián),從常用關(guān)聯(lián)列表中導(dǎo)出的關(guān)聯(lián)-由此開始,高優(yōu)先級關(guān)聯(lián), A is a physical or logical part of B. A is physically or logically contained in/on B. A is recorded in B.,關(guān)聯(lián)指南,集中于需要保存一定時(shí)間的關(guān)系(Need to know關(guān)聯(lián)) 提取概念類比識(shí)別關(guān)聯(lián)更重要,主要時(shí)間應(yīng)放在識(shí)別概念類 太多的關(guān)聯(lián)會(huì)使領(lǐng)域模型更混亂 耗時(shí),而效果遞減 避免顯示冗余或可導(dǎo)出的關(guān)聯(lián),角色,Each end of an association is called a role. Roles may optionally have: name ftp 2 multiplicity expression Navigability(導(dǎo)航),Multiplicity,The multiplicity value communicates(表明) how many instances can be validly associated with another, at a particular moment, rather than over a span of time. 一夫一妻制 舊車任一時(shí)刻只能被一個(gè)經(jīng)銷商進(jìn)貨,但一段時(shí)間內(nèi)可能反復(fù)被進(jìn)貨,The multiplicity value is dependent on our interest as a modeler and software developer 現(xiàn)實(shí)中,Item可以不存儲(chǔ)在任何Store中(如已賣出),但軟件中,Item總與一個(gè)Store相聯(lián)系,Naming Associations,TypeName-VerbPhrase-TypeName format verb phrase creates a sequence that is readable and meaningful in the model context. start with a capital letter association represents a classifier of links between instances; in the UML 兩種常用格式 Paid-by PaidBy,default direction to read an association name is left to right or top to bottom not a UML default, but a common convention.,Multiple Associations Between Two Types,Domain Modeling期間,association只是對現(xiàn)實(shí)世界的分析,不意味著需要實(shí)現(xiàn) 實(shí)現(xiàn)關(guān)聯(lián)最常用的方法:使用屬性,Unforgettable Relationships in the Store,Applying the Category of Associations Checklist,添加關(guān)聯(lián),識(shí)別名詞和名詞短語,領(lǐng)域模型添加屬性,屬性,Attribute of Sale,a receipt (which reports the information of a sale) normally includes a date and time, and management wants to know the dates and times of sales for a variety of reasons. Consequently, the Sale conceptual class needs a date and time attribute.,Multiplicity From SalesLineItem to Item,添加屬性,Exercise,Make a class diagram that captures the following: A company consists of departments and employees. A department has responsibility for zero, one or more projects. A company has: name, address and telephone. A department has name. A project has name. An employee has name, address, a social security number (SSN) and is participating in zero, one or more projects. Let the class diagram show: classes with attributes, relations (with role names) between the classes and multiplicity for the relations.,A bank has customers with different status. The bank offers different services depending on the status of a customer. A customer can have several accounts and several loans. For each customer the system must know his/her income for the last 12 months. Each customer has a collection of other customers which serve as his/her associates. An associate can be warrantor ( 擔(dān)保人) for a loan and can also upgrade the status of a customer. Each loan in the bank is associated with the house that it is used for. A house loan may need a warrantor. A customer may also use another house already in his/her possession as a security抵押品 for a loan. In that case, information about the address, taxvalue etc. for the security house is needed. The customer must also always specify the same information for the house which the loan concerns. Only customers of the bank may have a loan. Customers with payment complaints during the last three years cannot get loans.,什么是領(lǐng)域模型 概念類 識(shí)別和提取概念類 創(chuàng)建領(lǐng)域模型步驟 幾個(gè)問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,agile modeling approach,the purpose of creating a domain model is to quickly understand and communicate a rough approximation of the key concepts. agile models are usually discarded shortly after creation,Sketching a Class Diagram Tool?,命名,mapmaker strategy also named the Use the Domain Vocabulary strategy,用關(guān)聯(lián) or 屬性?,屬性簡單數(shù)據(jù)類型 關(guān)聯(lián)復(fù)雜數(shù)據(jù)類型,屬性某種數(shù)據(jù)類型,只關(guān)心值,不必要區(qū)分不同實(shí)體 Primitive data type number, string, boolean, date, or time non-primitive data type(also known as value objects, a non-primitive class, Data Type Classes) 概念類需要區(qū)分不同實(shí)體,概念類or屬性,常見錯(cuò)誤: 將應(yīng)該作為概念類的當(dāng)做屬性 -規(guī)則:若在現(xiàn)實(shí)世界中我們不把X當(dāng)作數(shù)字或文本,則X可能是概念類而不是屬性,If in doubt, make it a separate concept. Attributes should be fairly rare in a domain model.,屬性與外鍵,undesirable because its purpose is to relate the Cashier to a Register object.,Better relate types with an association, not with an attribute. There are many ways to relate objectsforeign keys being one defer how to implement the relation until design to avoid design creep(creep, not anticipated near the start),數(shù)量與單位,Most numeric quantities should not be represented as plain numbers. price or velocity 速度 These are quantities with associated units,Solution( In the general case,) represent Quantity as a distinct conceptual class, with an associated Unit,Quantities are considered data types (unique identity of instances is not important) it is acceptable to collapse their illustration into the attribute section of the class box,解決相似概念,A thing that records sales and payments, Register登記簿: a book that logged sales and payments. cash register:收銀機(jī) Acquire a generalized meaning over time. POST: point-of-sale terminal. In computerese, a terminal is any end-point device in a system, such as a client PC, a wireless networked PDA, and so forth.,Modeling the Unreal World,some candidate conceptual classes related to a telecom-munication switch: Message, Connection, Port, Dialog, Route, Protocol.,添加Specification/ description,the need for specification conceptual classes is common in many domain models.,規(guī)則:使用Specification/ description的場合 當(dāng)需要對Item或服務(wù)進(jìn)行描述(獨(dú)立于這些條目或服務(wù)當(dāng)前存在的任何具體例子)時(shí) 刪除實(shí)例會(huì)導(dǎo)致有用信息丟失時(shí)(這些信息和被刪除的東西不恰當(dāng)?shù)仃P(guān)聯(lián)在一起了) 要減少信息冗余,common in sales , product, and manufacturing Domains,a ProductSpecification (or ItemSpecification, ProductDescription .) conceptual class records information about items does not represent an Item, it represents a description of information about items it is common to state that an XSpecification Describes an X,又一例(服務(wù)),電信套餐 PackageDescription rates per minute wireless Internet content cost 實(shí)際賣出去的套餐 gold package sold to XXX on Jan. 1, 2047 at $55 per month,又一例(服務(wù)),航班失事,則取消所有航班(service),所有Flight對象刪除。則各個(gè)number的航班目的地信息全部丟失,應(yīng)該把number部分提取出來,同一種圖可用于不同視角的模型,Essential or conceptual perspective 現(xiàn)實(shí)世界 Specification perspective 獨(dú)立于語言的軟件世界 Implementation perspective 具體語言實(shí)現(xiàn),解決語義鴻溝-用相同的名稱 representational gap or semantic gap,Class general term representing either a real-world thing (a conceptual class) or software thing (a software class).,Conceptual class real-world concept or thing A conceptual or essential perspective The UP Domain Model contains conceptual classes.,Software class a class representing a specification or implementation perspective of a software component, regardless of the process or method. Des
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024-2025人教版(PEP)三年級下冊期末模擬卷(含答案含聽力原文無音頻)
- 工業(yè)園區(qū)綠色低碳化改造方案
- 工業(yè)廢棄地生態(tài)修復(fù)實(shí)踐案例
- 工業(yè)旅游的發(fā)展現(xiàn)狀及前景分析
- 工業(yè)機(jī)器人技術(shù)培訓(xùn)及故障排除
- 工業(yè)污染防治與生態(tài)保護(hù)
- 工業(yè)生產(chǎn)中熱風(fēng)爐的節(jié)能技術(shù)應(yīng)用案例
- 工業(yè)污染對森林環(huán)境的影響與修復(fù)策略
- 工業(yè)污染防治的技術(shù)與策略研究
- 工業(yè)自動(dòng)化設(shè)備維護(hù)與管理系統(tǒng)
- 公路水運(yùn)工程生產(chǎn)安全重大事故隱患判定標(biāo)準(zhǔn)2025
- (高清版)DG∕TJ 08-2093-2019 電動(dòng)汽車充電基礎(chǔ)設(shè)施建設(shè)技術(shù)標(biāo)準(zhǔn) 含2021年局部修訂
- 專利技術(shù)成果轉(zhuǎn)讓證明書(7篇)
- 廣東省廣州市番禺區(qū)2020年七年級第二學(xué)期期末區(qū)統(tǒng)考試卷(含答案)
- 藥物研發(fā)自動(dòng)化-全面剖析
- 股權(quán)回購合同協(xié)議書范本6篇
- 課程思政說課公務(wù)員制度講座情境創(chuàng)設(shè)下雙線四點(diǎn)的課程思政融入設(shè)計(jì)
- 2024年衛(wèi)生管理領(lǐng)軍者考試試題及答案
- 飼料行業(yè)粉塵防爆
- 預(yù)制菜烹飪知識(shí)培訓(xùn)課件
- 2025版各行業(yè)《重大事故隱患執(zhí)法檢查參考標(biāo)準(zhǔn)》
評論
0/150
提交評論