




已閱讀5頁,還剩123頁未讀, 繼續(xù)免費閱讀
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
領域模型概念的可視化,徐迎曉 復旦大學軟件學院,outline,什么是領域模型 概念類 識別和提取概念類 創(chuàng)建領域模型步驟 幾個問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,什么是領域模型 概念類 識別和提取概念類 創(chuàng)建領域模型步驟 幾個問題 命名 概念類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,領域模型domain model是概念類或 問題領域中實際對象的可視化表達,又稱為: 概念模型conceptual models 領域對象模型domain object models 分析對象模型analysis object models.,什么是領域模型 概念類 識別和提取概念類 創(chuàng)建領域模型步驟 幾個問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,概念模型,領域模型顯示問題領域中對建模者有意義的概念類 OOA中創(chuàng)建的最重要的制品 識別大量對象或概念類heart of OOA 領域模型表達的是現(xiàn)實世界中的概念類,而不是軟件構件(不是軟件類或帶有職責的軟件對象) 識別概念類是問題域調(diào)查的一部分 UML中的類圖可以顯示領域模型,使用UML表示法,領域模型用一組不帶操作的類圖來表示,可顯示: 領域對象或概念類 概念類之間的關聯(lián) 概念類的屬性,可視化字典,領域模型將領域中的單詞、概念類可視化,并將其相互關聯(lián)(比文字更容易閱讀) 領域模型顯示了視圖或抽象的一部分,而將建模者不感興趣的細節(jié)忽略。 創(chuàng)建領域模型同時有助于澄清領域中術語和詞匯可視化字典,不是軟件設計,領域模型是現(xiàn)實世界問題領域中事物的可視化,而不是軟件構件的可視化 不是軟件制品如window, database 不帶有職責和方法,領域模型顯示現(xiàn)實世界的概念,領域模型避免軟件制品或類,什么是領域模型 概念類 識別和提取概念類 創(chuàng)建領域模型步驟 幾個問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,創(chuàng)建領域模型步驟,列出候選概念類 在領域模型中畫出候選概念類 添加關系 添加屬性,什么是領域模型 概念類 識別和提取概念類 創(chuàng)建領域模型步驟 幾個問題 命名 概念類or屬性? 屬性與外鍵 數(shù)量和單位 添加Specification/ description 相似概念問題 Modeling the Unreal World 不同視角的模型 Process,領域模型識別和提取概念類,用概念類種類列表 識別名詞短語 使用分析模式,使用概念種類列表,store and airline reservation domains.,饑餓,恐高癥,識別名詞和名詞短語,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)建并公開的部分領域模型 Martin Fowler 分析模式:可復用的對象模型 Analysis Patterns Reusable Object Models Addison Wesley/Pearson 機械工業(yè)出版社 中國電力出版社(影印版),Martin Fowler的主要精品著作有 重構改善既有代碼的設計(Refactoring: Improving the Design of Existing Code)、 UML精粹:標準對象建模語言簡明指南(UML Distilled:A Brief Guide to the Standard Object Modeling) 分析模式:可重用的對象模型(Analysis Patterns:Reusable Object Models) 規(guī)劃極限編程(Planning Extreme Programming) 企業(yè)應用架構模式(Patterns of Enterprise Application Architecture)等,銷售領域候選概念類,POS系統(tǒ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.,領域模型添加關聯(lián),從前有座山,山上有座廟,廟里有個,添加關聯(lián),從常用關聯(lián)列表中導出的關聯(lián)-由此開始,高優(yōu)先級關聯(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.,關聯(lián)指南,集中于需要保存一定時間的關系(Need to know關聯(lián)) 提取概念類比識別關聯(lián)更重要,主要時間應放在識別概念類 太多的關聯(lián)會使領域模型更混亂 耗時,而效果遞減 避免顯示冗余或可導出的關聯(lián),角色,Each end of an association is called a role. Roles may optionally have: name ftp 2 multiplicity expression Navigability(導航),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. 一夫一妻制 舊車任一時刻只能被一個經(jīng)銷商進貨,但一段時間內(nèi)可能反復被進貨,The multiplicity value is dependent on our interest as a modeler and software developer 現(xiàn)實中,Item可以不存儲在任何Store中(如已賣出),但軟件中,Item總與一個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)實世界的分析,不意味著需要實現(xiàn) 實現(xiàn)關聯(lián)最常用的方法:使用屬性,Unforgettable Relationships in the Store,Applying the Category of Associations Checklist,添加關聯(lián),識別名詞和名詞短語,領域模型添加屬性,屬性,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 ( 擔保人) 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.,什么是領域模型 概念類 識別和提取概念類 創(chuàng)建領域模型步驟 幾個問題 命名 概念類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,用關聯(lián) or 屬性?,屬性簡單數(shù)據(jù)類型 關聯(lián)復雜數(shù)據(jù)類型,屬性某種數(shù)據(jù)類型,只關心值,不必要區(qū)分不同實體 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ū)分不同實體,概念類or屬性,常見錯誤: 將應該作為概念類的當做屬性 -規(guī)則:若在現(xiàn)實世界中我們不把X當作數(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:收銀機 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的場合 當需要對Item或服務進行描述(獨立于這些條目或服務當前存在的任何具體例子)時 刪除實例會導致有用信息丟失時(這些信息和被刪除的東西不恰當?shù)仃P聯(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,又一例(服務),電信套餐 PackageDescription rates per minute wireless Internet content cost 實際賣出去的套餐 gold package sold to XXX on Jan. 1, 2047 at $55 per month,又一例(服務),航班失事,則取消所有航班(service),所有Flight對象刪除。則各個number的航班目的地信息全部丟失,應該把number部分提取出來,同一種圖可用于不同視角的模型,Essential or conceptual perspective 現(xiàn)實世界 Specification perspective 獨立于語言的軟件世界 Implementation perspective 具體語言實現(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)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025四川房屋租賃合同范本
- 2025空調(diào)維修保養(yǎng)合同
- 2025年度上級批準的合同文件作為審查合同的原始依據(jù)
- 銀行業(yè)的科技革新
- 2025電影編劇委托創(chuàng)作合同
- 2025標準版設備租賃合同
- 《2025年終止物業(yè)管理合同的協(xié)議》
- 2025長期雇傭合同的變革
- 2025吊車租賃合同范本2
- 學服裝設計的基礎
- 美國加征關稅從多個角度全方位解讀關稅課件
- “皖南八校”2024-2025學年高一第二學期期中考試-英語(譯林版)及答案
- 定額〔2025〕1號文-關于發(fā)布2018版電力建設工程概預算定額2024年度價格水平調(diào)整的通知
- 【MOOC】機械原理-西北工業(yè)大學 中國大學慕課MOOC答案
- 一種基于STM32的智能門鎖系統(tǒng)的設計-畢業(yè)論文
- 《運營管理》案例庫
- 煤礦安全監(jiān)控系統(tǒng)設備管理報廢制度
- 機關事業(yè)單位退休人員養(yǎng)老金領取資格確認表
- 第五屆“國藥工程杯”全國大學生制藥工程設計競賽
- 柔性主動防護網(wǎng)分項工程質(zhì)量檢驗評定表
- 中機2015~2016年消防系統(tǒng)維保養(yǎng)護年度總結報告
評論
0/150
提交評論