领域模型概念的可视化_第1页
领域模型概念的可视化_第2页
领域模型概念的可视化_第3页
领域模型概念的可视化_第4页
领域模型概念的可视化_第5页
已阅读5页,还剩123页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、领域模型概念的可视化outline什么是领域模型概念类识别和提取概念类创建领域模型步骤几个问题l命名l概念类or属性?l属性与外键l数量和单位l添加specification/ descriptionl相似概念问题lmodeling the unreal world不同视角的模型process什么是领域模型概念类识别和提取概念类创建领域模型步骤几个问题l命名l概念类or属性?l属性与外键l数量和单位l添加specification/ descriptionl相似概念问题lmodeling the unreal world不同视角的模型processuse cases:limportant re

2、quirements analysis artifact, but are not object-oriented.lemphasize a process view of the domain.domain modellthe most important artifact to create in ooa领域模型domain model是概念类或问题领域中实际对象的可视化表达,又称为:l概念模型conceptual modelsl领域对象模型domain object modelsl分析对象模型analysis object models.什么是领域模型概念类识别和提取概念类创建领域模型步

3、骤几个问题l命名l概念类or属性?l属性与外键l数量和单位l添加specification/ descriptionl相似概念问题lmodeling the unreal world不同视角的模型process概念模型l领域模型显示问题领域中对建模者有意义的概念类l ooa中创建的最重要的制品l 识别大量对象或概念类heart of ooal领域模型表达的是现实世界中的概念类,而不是软件构件(不是软件类或带有职责的软件对象)l识别概念类是问题域调查的一部分luml中的类图可以显示领域模型使用uml表示法,领域模型用一组不带操作的类图来表示,可显示:l领域对象或概念类l概念类之间的关联l概念类的

4、属性可视化字典领域模型将领域中的单词、概念类可视化,并将其相互关联(比文字更容易阅读)领域模型显示了视图或抽象的一部分,而将建模者不感兴趣的细节忽略。创建领域模型同时有助于澄清领域中术语和词汇可视化字典不是软件设计领域模型是现实世界问题领域中事物的可视化,而不是软件构件的可视化l不是软件制品如window, databasel不带有职责和方法领域模型显示现实世界的概念领域模型避免软件制品或类什么是领域模型概念类识别和提取概念类创建领域模型步骤几个问题l命名l概念类or属性?l属性与外键l数量和单位l添加specification/ descriptionl相似概念问题lmodeling the

5、 unreal world不同视角的模型process创建领域模型步骤列出候选概念类在领域模型中画出候选概念类添加关系添加属性什么是领域模型概念类识别和提取概念类创建领域模型步骤几个问题l命名l概念类or属性?l属性与外键l数量和单位l添加specification/ descriptionl相似概念问题lmodeling the unreal world不同视角的模型process领域模型识别和提取概念类l用概念类种类列表l识别名词短语l使用分析模式使用概念种类列表store and airline reservation domains.饥饿,恐高症 识别名词和名词短语it is anot

6、her source of inspiration.care:la mechanical noun-to-class mapping isnt possiblelwords in natural languages are ambiguouslit is recommended in combination with the conceptual class category list technique. some are candidate conceptual classessome maybe ignored in this iteration (accounting and comm

7、issions)some may be attributes of conceptual classes.(price)使用分析模式由专家创建并公开的部分领域模型martin fowler分析模式:可复用的对分析模式:可复用的对象模型象模型 analysis patterns reusable object models addison wesley/pearson 机械工业出版社 中国电力出版社(影印版)martin fowler的主要精品著作有l重构改善既有代码的设计(refactoring: improving the design of existing code)、luml精粹:标准

8、对象建模语言简明指南(uml distilled:a brief guide to the standard object modeling)l分析模式:可重用的对象模型(analysis patterns:reusable object models) l规划极限编程(planning extreme programming)l企业应用架构模式(patterns of enterprise application architecture)等销售领域候选概念类pos系统领域模型group sizeyou should preferably be 5-7 persons in the grou

9、p 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

10、expert in the groupone 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 identifyingconcepts1. each person is ass

11、igned 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 con

12、cepts for the problem area. divide the concepts into three groups:l1. concepts which everybody thinks are importantl2. concepts that fall outside the problem area, are more suitable as attributes, concepts with the same meaning etc.l3. concepts which fall in between these groups.4. discuss the conce

13、pts in group 3 which not everyone agrees on. these concepts should be treated consistently.principles for brainstormingall ideas are equally importantthink quickly, not too much consideration; think more laterlet everyone speak (round-robin technique)a good mood can be an important strengthgood conc

14、eptsit 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.领域模型添加关联从前有座山,山上有座庙

15、,庙里有个添加关联从常用关联列表中导出的关联-由此开始高优先级关联 a is a physical or logical part of b. a is physically or logically contained in/on b. a is recorded in b.关联指南集中于需要保存一定时间的关系(need to know关联)提取概念类比识别关联更重要,主要时间应放在识别概念类太多的关联会使领域模型更混乱l耗时,而效果递减l避免显示冗余或可导出的关联角色each end of an association is called a role.roles may optional

16、ly have:lname ftp 2lmultiplicity expressionlnavigability(导航)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.l一夫一妻制l旧车任一时刻只能被一个经销商进货,但一段时间内可能反复被进货the multiplicity value

17、 is dependent on our interest as a modeler and software developerl现实中,item可以不存储在任何store中(如已卖出),但软件中,item总与一个store相联系naming associationstypename-verbphrase-typename formatlverb phrase creates a sequence that is readable and meaningful in the model context.lstart with a capital letterlassociation repr

18、esents a classifier of links between instances; in the umll两种常用格式lpaid-bylpaidbydefault direction to read an association name is left to right or top to bottomlnot a uml default, but a common convention. multiple associations between two typesdomain modeling期间,association只是对现实世界的分析,不意味着需要实现实现关联最常用的方

19、法:使用属性unforgettable relationships in the storeapplying the category of associations checklist添加关联识别名词和名词短语领域模型添加属性属性attribute of salea 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 reaso

20、ns.l consequently, the sale conceptual class needs a date and time attribute.multiplicity from saleslineitem to itemcup1 : item : sale : salelineitem : salelineitem : salelineitemcup2 : item : itemcup1 : item : sale : salelineitem : salelineitem : salelineitemcup2 : item : item添加属性exercisemake a cla

21、ss 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)

22、 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. employee- name : string- address : string- ssn : stringcompany- name : string- address : string- phone : string

23、*1.*1.*works forproject- name : string*participate indepartment- name : string0.n10.n1consist of*1*1belongs toa 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 custome

24、r 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

25、 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 fo

26、r 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命名l概念类or属性?l属性与外键l数量和单位l添加specification/ descriptionl相似概念问题lmodeling the unreal world不同视角的模型processagile mod

27、eling 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 strategyalso named the use the domain vocabulary strategy用关联

28、or 属性?属性简单数据类型关联复杂数据类型属性某种数据类型,只关心值,不必要区分不同实体lprimitive data typelnumber, string, boolean, date, or time lnon-primitive data type(also known as value objects, a non-primitive class, data type classes)概念类需要区分不同实体概念类or属性常见错误: 将应该作为概念类的当做属性-规则:若在现实世界中我们不把x当作数字或文本,则x可能是概念类而不是属性 if in doubt, make it a se

29、parate concept. attributes should be fairly rare in a domain model.属性与外键 undesirable lbecause its purpose is to relate the cashier to a register object.betterlrelate types with an association, not with an attribute.lthere are many ways to relate objectsforeign keys being oneldefer how to implement t

30、he relation until designlto avoid design creep(creep, not anticipated near the start)数量与单位most numeric quantities should not be represented as plain numbers.lprice or velocity 速度lthese are quantities with associated units, solution( in the general case,)lrepresent quantity as a distinct conceptual c

31、lass, with an associated unitquantities are considered data types (unique identity of instances is not important)lit is acceptable to collapse their illustration into the attribute section of the class box解决相似概念a thing that records sales and payments,register登记簿:la book that logged sales and payment

32、s.lcash register:收银机lacquire a generalized meaning over time. post: point-of-sale terminal.lin 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 worldsome candidate conceptual classes related to a telecom-muni

33、cation switch: message, connection, port, dialog, route, protocol.添加specification/ descriptionthe need for specification conceptual classes is common in many domain models.规则:使用specification/ description的场合l当需要对item或服务进行描述(独立于这些条目或服务当前存在的任何具体例子)时l删除实例会导致有用信息丢失时(这些信息和被删除的东西不恰当地关联在一起了)l要减少信息冗余common i

34、n sales , product, and manufacturing domainsa 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 xspecification describes an

35、x又一例(服务)电信套餐packagedescription rates per minute wireless internet content cost实际卖出去的套餐lgold package sold to xxx on jan. 1, 2047 at $55 per month又一例(服务)航班失事,则取消所有航班(service),所有flight对象删除。则各个number的航班目的地信息全部丢失,应该把number部分提取出来同一种图可用于不同视角的模型essential or conceptual perspectivel现实世界现实世界specification persp

36、ectivel独立于语言的软件世界implementation perspectivel具体语言实现解决语义鸿沟-用相同的名称representational gap or semantic gapclasslgeneral term lrepresenting either a real-world thing (a conceptual class) or software thing (a software class). conceptual classlreal-world concept or thingla conceptual or essential perspectivel

37、the up domain model contains conceptual classes. software classla class representing a specification or implementation perspective of a software component, regardless of the process or method. design classla member of the up design modella synonym for software classleither a specification or impleme

38、ntation perspective, as desired by the modeler.implementation classla class implemented in an object-oriented language such as java.report objectsinclude receipt in the model?no-in general, showing a report of other information in a domain model is not useful since all its information is derived fro

39、m other sources;yes-a receipt has a special role in terms of the business rules.赋予持有者退货的权利(return bought items)l本次迭代未考虑退货,因而不包括receipt,处理handle returns的迭代中再考虑领域模型和up初始-no细化-l主要在此创建,当需要理解值得注意的概念,并映射到部分设计工作的类中l熟练者每次迭代只需几小时来开发领域模型,若是用预定义的分析模式,还将更快the up business object model vs. domain modelbusiness ob

40、ject modellthe 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. rupl用几种不同的图表示 (class, activity, and sequence)l显示整个企业如何运作l若做整个企业的business process engineering最有用 domain modellbom的一个子集,更常创

41、建lyou can choose to develop an incomplete business object model, focusing on explaining things and products important to a domain. . this is often referred to as a domain model. rupgpdlai6f3c0y)v&s#pxmuirfnck9h5e2b+x(u$rzowkthqembj7g4d1z-w*t!qymvjsgodlai6f3b0y)v%s#pxluiqfnck8h5e2a+x*u$rznwkthpemaj7g

42、4c1z-w&t!qymvjnck9h5e2b+x(u$rzowkthqembj7g4d1z-w*t!qymvjsgodlai6f3b0y)v%s#pxluiqfnck8h5e2a+x(u$rznwkthpembj7g4c1z-w&t!qymvjrgodl9i6f3b0y(v%s#oxluiqfnbk8h5d2a+x*u$qznwkshpemaj7f4c1z)w&t!pymujrgocl9i6e3b0y(v%r#oxltiqfnbk8g5d2a-x*u$qznvkshpdmaj7f4c0z)w&s!pymujrfocl9h6e3b+y(u%r#owltiqenbj8g5d1a-x*t$qznv

43、ksgpdmai7f4c0z)v&s!pxmujrfock9h6e2b+y(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0y)v&s#pxmuirfock9h5e2b+x(u%rzowkthqembj8g4d1z-w*t!qynvjsgodlai6f3c0y)v%s#pxluirfnck8h5e2a+x(u$rznwkthpembj7g4c1z-w&t!qymvjsgodl9i6f3b0y)v%s#oxluiqfnck8h5d2a+x*u$rznwkshpemaj7g4c1z)w&t!pymvjrgocl9i6e3b0y(v%r#oxltiqfnbk8h5

44、d2a-x*u$qznwkshpdmaj7f4c1z)w&s!pymujrgocl9h6e3b+y(v%r#owltiqenbk8g5d1a-x*t$qznvksgpdmai7f4c0z)v&s!pxmujrfocl9h6e2b+y(u%r#owlthqenbj8g5d1a-w*t$qynvksgpdlai7f3c0z)v&s#pxmuirfock9h5e2b+x(u%rzowkthqembj8g4d1a-w*t!qynvjsgpdlai6f3c0y)v&s#pxluirfnck9h5e2a+x(u$rzowkthpembj7g4d1z-w&t!qymvjsgodl9i6f3b0y)v%s#p

45、xluiqfnck8h5e2a+x*u$rznwkthpemaj7g4c1z-w&t!pymvjrgodl9i6e3b0y(v%s#oxltiqfnbk8h5d2a-x*u$qznwkshpdmaj7f4c1z)w&t!pymujrgocl9i6e3b+y(v%r#oxltiqenbk8g5d2a-x*t$qznvkshpdmai7f4c0z)w&s!pxmujrfocl9h6e2b+y(u%r#owltiqenbj8g5d1a-x*t$qynvksgpdmai7f3c0z)v&s!pxmuirfock9h6e2b+x(u%rzowlthqembj8g4d1a-w*t!qynvjsgpdlai

46、6f3c0y)v&s#pxmuirfnck9h5e2b+x(u$rzowkthqembj7g4d1z-w*t!qymvjsgodlai6f3b0y)v%s#pxluiqfnck8h5e2a+x*u$rznwkthpembj7g4c1z-w&t!qymvjrgodl9i6f3b0y(v%s#oxluiqfnbk8h5d2a+x*u$qznwkshpemaj7f4c1z)w&t!pymujrgocl9i6e3b0y(v%r#oxltiqfnbk8g5d2a-x*u$qznvkshpdmaj7f4c0z)w&s!pymujrfocl9h6e3b+y(u%r#owltiqenbj8g5d1a-!pym

47、vjrgocl9i6e3b0y(v%r#oxltiqfnbk8g5d2a-x*u$qznvkshpdmaj7f4c0z)w&s!pymujrfocl9h6e3b+y(u%r#owltiqenbk8g5d1a-x*t$qznvksgpdmai7f4c0z)v&s!pxmujrfock9h6e2b+y(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0y)v&s#pxmuirfock9h5e2b+x(u%rzowkthqembj8g4d1z-w*t!qynvjsgodlai6f3c0y)v%s#pxluirfnck8h5e2a+x(u$rznwkthpembj7g

48、4d1z-w&t!qymvjsgodl9i6f3b0y)v%s#oxluiqfnck8h5d2a+x*u$rznwkshpemaj7g4c1z)w&t!pymvjrgocl9i6e3b0y(v%s#oxltiqfnbk8h5d2a-x*u$qznwkshpdmaj7f4c1z)w&s!pymujrgocl9h6e3b+y(v%r#owltiqenbk8g5d1a-x*t$qznvksgpdmai7f4c0z)w&s!pxmujrfocl9h6e2b+y(u%r#owlthqenbj8g5d1a-w*t$qynvksgpdlai7f3c0z)v&s#pxmuirfock9h5e2b+x(u%rz

49、owlthqembj8g4d1a-w*t!qynvjsgpdlai6f3c0y)v&s#pxluirfnck9h5e2a+x(u$rzowkthpembf3c0z)v&s#pxmuirfock9h6e2b+x(u%rzowlthqembj8g4d1a-w*t!qynvjsgpdlai6f3c0y)v&s#pxluirfnck9h5e2a+x(u$rzowkthpembj7g4d1zoxltiqenbk8g5d2a-x*t$qznvkshpdmai7f4c0z)w&s!pxmujrfocl9h6e2b+y(u%r#owlthqenbj8g5d1a-x*t$qynvksgpdmai7f3c0z)v

50、&s!pxmuirfock9h6e2b+x(u%rzowlthqembj8g4d1a&s!pxmujrfocl9h6e3b+y(u%r#owltiqenbj8g5d1a-x*t$qynvksgpdmai7f3c0z)v&s!pxmuirfock9h6e2b+x(u%rzowlthqembj8g4d1a-w*t!qynvjsgpdlai7f3c0y)v&s#pxmuirj8g5d1a-x*t$qynvksgpdmai7f3c0z)v&s!pxmuirfock9h6e2b+x(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0y)v&s#pxmuirfnck9h5

51、e2b+x(u$rzowkthqembj7c0z)v&s!pxmuirfock9h6e2b+y(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0y)v&s#pxmuirfnck9h5e2b+x(u$rzowkthqembj7g4d1z-w*t!qynvjsgodla2b+y(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0y)v&s#pxmuirfnck9h5e2b+x(u$rzowkthqembj8g4d1z-w*t!qynvjsgk9h6e2b+y(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0y)v&s#pxmuirfock9h5e2b+x(u%rzowkthqembj8g4d1z-w*t!mujrfock9h6e2b+y(u%rzowlthqenbj8g4d1a-w*t$qynvjsgpdlai7f3c0z)v&s#pxmuirfock9h5e2b+x(u%rzowkthqembj8g4d1z-w

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论