版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、領(lǐng)域模型-概念的可視化領(lǐng)域模型概念的可視化Content什么是領(lǐng)域模型概念類識(shí)別和提取概念類創(chuàng)建領(lǐng)域模型步驟幾個(gè)問(wèn)題命名概念類or屬性?相似概念問(wèn)題Modeling the Unreal World不同視角的模型Process什么是領(lǐng)域模型Use cases:important requirements analysis artifact, but are not object-oriented.emphasize a process view of the domain.Domain modelThe most important artifact to create in OOA概念模型領(lǐng)
2、域模型顯示問(wèn)題領(lǐng)域中對(duì)建模者有意義的概念類 OOA中創(chuàng)建的最重要的制品 識(shí)別大量對(duì)象或概念類heart of OOA領(lǐng)域模型表達(dá)的是現(xiàn)實(shí)世界中的概念類,而不是軟件構(gòu)件(不是軟件類或帶有職責(zé)的軟件對(duì)象)識(shí)別概念類是問(wèn)題域調(diào)查的一部分UML中的類圖可以顯示領(lǐng)域模型領(lǐng)域模型domain model是概念類或問(wèn)題領(lǐng)域中實(shí)際對(duì)象的可視化表達(dá),又稱為:概念模型conceptual models領(lǐng)域?qū)ο竽P蚫omain object models分析對(duì)象模型analysis object models.使用UML表示法,領(lǐng)域模型用一組不帶操作的類圖來(lái)表示,可顯示:領(lǐng)域?qū)ο蠡蚋拍铑惛拍铑愔g的關(guān)聯(lián)概念類的屬性
3、部分領(lǐng)域模型可視化字典領(lǐng)域模型將領(lǐng)域中的單詞、概念類可視化,并將其相互關(guān)聯(lián)(比文字更容易閱讀)領(lǐng)域模型顯示了視圖或抽象的一部分,而將建模者不感興趣的細(xì)節(jié)忽略。創(chuàng)建領(lǐng)域模型同時(shí)有助于澄清領(lǐng)域中術(shù)語(yǔ)和詞匯可視化字典不是軟件設(shè)計(jì)領(lǐng)域模型是現(xiàn)實(shí)世界問(wèn)題領(lǐng)域中事物的可視化,而不是軟件構(gòu)件的可視化不是軟件制品如window, database不帶有職責(zé)和方法領(lǐng)域模型顯示現(xiàn)實(shí)世界的概念領(lǐng)域模型避免軟件制品或類概念類概念類的三層意思概念類是思想、事物或?qū)ο罂梢詮囊韵聨追矫胬斫飧拍铑悾悍?hào)symbol代表概念的單詞或圖像內(nèi)涵intension概念的定義外延extension概念所應(yīng)用于的例子的集合概念類的三層意
4、思When creating a domain model, it is usually the symbol and intensional view of a conceptual class that are of most practical interest.識(shí)別和提取概念類識(shí)別領(lǐng)域中的概念類Store, Register, Sale過(guò)度指定領(lǐng)域模型(帶有大量細(xì)粒度的概念類)比不足好(越多越好)開始常會(huì)遺漏,在后面考慮屬性、關(guān)聯(lián)以及在設(shè)計(jì)階段時(shí),發(fā)現(xiàn)遺漏可隨時(shí)補(bǔ)充Do not exclude a conceptual class simply becauseIt has no att
5、ributesthe requirements do not indicate any obvious need to remember information about it技巧用概念類種類列表識(shí)別名詞短語(yǔ)使用分析模式使用概念種類列表store and airline reservation domains.饑餓,恐高癥識(shí)別名詞和名詞短語(yǔ)it is another source of inspiration.Care:a mechanical noun-to-class mapping isnt possiblewords in natural languages are ambiguou
6、sit is recommended in combination with the Conceptual Class Category List technique.Some are candidate conceptual classesSome maybe ignored in this iteration (Accounting and commissions)Some may be attributes of conceptual classes.(Price)使用分析模式由專家創(chuàng)建并公開的部分領(lǐng)域模型銷售領(lǐng)域候選概念類Report ObjectsInclude Receipt in
7、 the Model?No-In general, showing a report of other information in a domain model is not useful since all its information is derived from other sources;Yes-A receipt has a special role in terms of the business rules.賦予持有者退貨的權(quán)利(return bought items)本次迭代未考慮退貨,因而不包括Receipt,處理Handle Returns的迭代中再考慮創(chuàng)建領(lǐng)域模型步
8、驟列出候選概念類在領(lǐng)域模型中畫出候選概念類添加關(guān)系添加屬性幾個(gè)問(wèn)題命名mapmaker strategyMake a domain model in the spirit of how a cartographer or mapmaker works: Use the existing names in the territory(地區(qū),領(lǐng)域). Exclude irrelevant features(地形圖,人口分布) Do not add things that are not there.also named the Use the Domain Vocabulary strategy常
9、見錯(cuò)誤將應(yīng)該作為概念類的當(dāng)做屬性-規(guī)則:若在現(xiàn)實(shí)世界中我們不把X當(dāng)作數(shù)字或文本,則X可能是概念類而不是屬性If we do not think of some conceptual class X as a number or text in the real world, X is probably a conceptual class, not an attribute.If in doubt, make it a separate concept. Attributes should be fairly rare in a domain model.解決相似概念A(yù) thing that
10、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.as a rule of
11、 thumb, a domain model is not absolutely correct or wrong, but more or less useful; it is a tool of communication.解決相似概念登記簿Register和POST功能一樣。但Register更抽象,POST更面向?qū)崿F(xiàn),是否應(yīng)該用Register而不是POST?各有優(yōu)缺點(diǎn)mapmaker principle, “POST” is a term familiar in the territoryPOST好,易于交流從模型的目的:抽象,實(shí)現(xiàn)獨(dú)立Register好,Modeling the U
12、nreal Worldsome candidate conceptual classes related to a telecom-munication switch: Message, Connection, Port, Dialog, Route, Protocol.添加Specification/ descriptionthe need for specification conceptual classes is common in many domain models.添加Specification/ description商品ItemItem具有price, and itemID,
13、沒有在其他地方記錄物理商品被賣出,軟件實(shí)例即刪除cup1,cup2,cup3,全部售完,則沒有了cup的記錄,-Cup多少錢?無(wú)法回答a ProductSpecification (or ItemSpecification, ProductDescription .) conceptual class records information about itemsdoes not represent an Item, it represents a description of information about itemsit is common to state that an XSpec
14、ification Describes an X規(guī)則:使用Specification/ description的場(chǎng)合當(dāng)需要對(duì)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又一例(服務(wù))航班失事,則取消所有航班(service),所有Flight對(duì)象刪除。則各個(gè)number的航班目的地信息全部丟失,應(yīng)該把number部分提取出來(lái)不同視角的模型同一種圖可用于不同視角的模型Essenti
15、al or conceptual perspective現(xiàn)實(shí)世界Specification perspective獨(dú)立于語(yǔ)言的軟件世界Implementation perspective具體語(yǔ)言實(shí)現(xiàn)解決語(yǔ)義鴻溝-用相同的名稱representational gap or semantic gap Conceptual classreal-world concept or thingA conceptual or essential perspectiveThe UP Domain Model contains conceptual classes. Software classa class
16、representing a specification or implementationperspective of a software component, regardless of the process or method. Design classa member of the UP Design Modela synonym for software classeither a specification or implementation perspective, as desired by the modeler.Implementation classa class i
17、mplemented in an object-oriented language such as Java.Classgeneral term representing either a real-world thing (a conceptual class) or software thing (a software class).POS系統(tǒng)領(lǐng)域模型領(lǐng)域模型和UP初始-no細(xì)化-主要在此創(chuàng)建,當(dāng)需要理解值得注意的概念,并映射到部分設(shè)計(jì)工作的類中熟練者每次迭代只需幾小時(shí)來(lái)開發(fā)領(lǐng)域模型,若是用預(yù)定義的分析模式,還將更快The UP Business Object Model vs. Doma
18、in ModelBusiness Object ModelThe UP BOM serves as an abstraction of how business workers and business entities need to be related and how they need to collaborate in order to perform the business. RUPrepresented with several different diagrams (class, activity, and sequence)illustrate how the entire
19、 enterprise runsmost useful if doing enterprise-wide business process engineering, Domain Modelmore commonly created subset artifact or specialization of the BOM.You can choose to develop an incomplete business object model, focusing on explaining things and products important to a domain. . This is
20、 often referred to as a domain model. RUP領(lǐng)域設(shè)計(jì)制品領(lǐng)域模型添加關(guān)聯(lián)Criteria for Useful AssociationsConsider including the following associations in a domain model: Associations for which knowledge of the relationship needs to be pre-served for some duration (need-to-know associations). Associations derived from
21、 the Common Associations List.Many lines on the diagram will add “visual noise” and make it less comprehensible盡量少加Need to knowTo reconstruct a sale, print a receipt, or calculate a sale total.the requirements do not suggest that any such relationship is needed.添加關(guān)聯(lián)從常用關(guān)聯(lián)列表中導(dǎo)出的關(guān)聯(lián)-由此開始高優(yōu)先級(jí)關(guān)聯(lián) A is a ph
22、ysical 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)更重要太多的關(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:namemultiplicity expressionNavigability(導(dǎo)航)Multipl
23、icityThe multiplicity value communicates(表明) how many instances can be validly associated with another, at a particular moment, rather than over a span of time.一夫一妻制中。任一時(shí)刻只能與一人結(jié)婚,但一段時(shí)間內(nèi)可能與多人結(jié)婚舊車任一時(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
24、developer現(xiàn)實(shí)中,Item可以不存儲(chǔ)在任何Store中(如已賣出),但軟件中,Item總與一個(gè)Store相聯(lián)系Naming AssociationsTypeName-VerbPhrase-TypeName formatverb phrase creates a sequence that is readable and meaningful in the model context.start with a capital letterassociation represents a classifier of links between instances; in the UML兩種
25、常用格式Paid-byPaidBydefault direction to read an association name is left to right or top to bottomnot a UML default, but a common convention.Multiple Associations Between Two TypesUnforgettable Relationships in the StoreApplying the Category of Associations Checklist添加關(guān)聯(lián)領(lǐng)域模型添加屬性包含什么樣的屬性任何針對(duì)屬性的聲明,應(yīng)該在現(xiàn)實(shí)
26、世界實(shí)體的語(yǔ)境中加以解釋 領(lǐng)域模型中應(yīng)該包含以下屬性a receipt收銀條 (which reports the information of a sale) normally includes a date and time, andmanagement 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.用關(guān)聯(lián) or 屬性?屬性簡(jiǎn)單數(shù)據(jù)類型關(guān)聯(lián)復(fù)雜數(shù)據(jù)類型The
27、 type of an attribute should not normally be a complex domain concept such as a Sale or Airport.屬性與代碼實(shí)現(xiàn) 領(lǐng)域模型中屬性用Simple data type, 不意味著OOPL中的屬性也必須Simple, primitive data typeduring design and implementation workone of a number of possible design solutions to implement an associationthe associations be
28、tween objects expressed in the domain model will often be implemented as attributes that reference other complex software objectsthis is one solution, decision should be deferred during domain modeling.屬性,data type,概念類Attribute (data type) Attributes should generally be data types.a UML term that im
29、plies a set of values for which unique identity is not meaningfulAttribute (data type)For example, it is not (usually) meaningful to distinguish between: Separate instances of the Number 5. Separate instances of the String cat. Separate instances of PhoneNumber that contain the same number. Separate
30、 instances of Address that contain the same address.only value-based comparisons are relevant.Conceptual classit is meaningful to distinguish (by identity) between two separate instances of a Person whose names are both Jill Smithcompare the memory addresses of Person instances,屬性(data type) or 概念類?
31、Make it an attribute if it is naturally thought of as number, string, boolean, date, or time (and so on)Otherwiserepresent it as a separate conceptual class.If in doubtdefine something as a separate conceptual class rather than as anattribute.屬性primitive data typesuch as a number or stringnon-primitive data type.PhoneNumberalso known as value objectsa non-primitive classData Type Classes促銷價(jià)Universal Product Code (UPC) or European Article Number (EAN)以前作為Primitive data type的在以下情況下可能表示為Non-primitive type應(yīng)用以上原則盡管實(shí)例的唯一身份無(wú)意義,但仍值得作為單獨(dú)的類item identifierno
溫馨提示
- 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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 班級(jí)戶外策劃方案
- 石河子大學(xué)《園林工程制圖》2021-2022學(xué)年第一學(xué)期期末試卷
- 房屋維修協(xié)議書范本(11篇)
- 石河子大學(xué)《跨文化傳播》2023-2024學(xué)年第一學(xué)期期末試卷
- 沈陽(yáng)理工大學(xué)《數(shù)字圖像處理》2022-2023學(xué)年期末試卷
- 沈陽(yáng)理工大學(xué)《俄羅斯文學(xué)史》2022-2023學(xué)年第一學(xué)期期末試卷
- 沈陽(yáng)理工大學(xué)《超精密制造工程》2023-2024學(xué)年第一學(xué)期期末試卷
- 國(guó)家工商總局 建設(shè)工程勘察合同
- 合伙人招募合同
- 2024高考政治一輪復(fù)習(xí)第三單元發(fā)展社會(huì)主義民主政治第六課我國(guó)的人民代表大會(huì)制度課時(shí)作業(yè)含解析必修2
- 工業(yè)數(shù)字化智能化2030白皮書
- 田徑競(jìng)賽規(guī)則與裁判法課件
- 隧道高空作業(yè)安全要求
- 裝飾裝修技術(shù)標(biāo)范本
- 小學(xué)道德與法治人教六上冊(cè)我們的國(guó)家機(jī)構(gòu)我們是場(chǎng)外代表
- 國(guó)家開放大學(xué)2022年秋季《建筑測(cè)量》形成性考核及實(shí)驗(yàn)報(bào)告
- 【食品安全風(fēng)險(xiǎn)隱患排查記錄】資料
- 第五版-FMEA-新版FMEA【第五版】
- 新疆紀(jì)要維吾爾族的起源和形成
- 動(dòng)物遺傳育種繁殖學(xué)
- 2023年全國(guó)高考體育單招考試數(shù)學(xué)模擬試卷試題(含答案詳解)
評(píng)論
0/150
提交評(píng)論