领域模型概念的可视化53课件.ppt

上传人(卖家):晟晟文业 文档编号:4431402 上传时间:2022-12-08 格式:PPT 页数:128 大小:1.72MB
下载 相关 举报
领域模型概念的可视化53课件.ppt_第1页
第1页 / 共128页
领域模型概念的可视化53课件.ppt_第2页
第2页 / 共128页
领域模型概念的可视化53课件.ppt_第3页
第3页 / 共128页
领域模型概念的可视化53课件.ppt_第4页
第4页 / 共128页
领域模型概念的可视化53课件.ppt_第5页
第5页 / 共128页
点击查看更多>>
资源描述

1、领域模型概念的可视化徐迎晓xuyingxiao126复旦大学软件学院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不同视角的模型ProcessU

2、se cases:limportant requirements 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领域

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

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

6、名词和名词短语it is another 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(Acco

7、unting and commissions)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 C

8、ode)、lUML精粹:标准对象建模语言简明指南(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 person

9、s 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 do

10、main 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 concepts

12、 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 concepts in group

13、 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 conceptsIt is import

14、ant 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 optionally have:lname ftp 20

16、2.120.127.92lmultiplicity 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 is dependent on our in

17、terest 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 represents a classifier of

18、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只是对现实世界的分析,不意味着需要实现实现关联最常用的方法:使用属性Unforgettable Relati

19、onships 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 reasons.l Consequently,the Sale co

20、nceptual 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 class diagram that captures the following:A company consists

21、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 diagr

22、am 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*1.*1.*works forProject-name:String*participate inDepartment-name:String0.n10.n1consist of*1*1

23、belongs 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 customer the system must know his/her income for the last 12 months.Each customer has a collection of other cu

24、stomers 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 posse

25、ssion 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 dur

26、ing the last three years cannot get loans.什么是领域模型概念类识别和提取概念类创建领域模型步骤几个问题l命名l概念类or属性?l属性与外键l数量和单位l添加Specification/descriptionl相似概念问题lModeling the Unreal World不同视角的模型Processagile modeling approach,the purpose of creating a domain model is to quickly understand and communicate a rough approximation of

27、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用关联 or 属性?属性简单数据类型关联复杂数据类型属性某种数据类型,只关心值,不必要区分不同实体lPrimitive data typelnumber,string,boolean,date,or time lnon-primitive data t

28、ype(also known as value objects,a non-primitive class,Data Type Classes)概念类需要区分不同实体概念类or属性常见错误:将应该作为概念类的当做属性-规则:若在现实世界中我们不把X当作数字或文本,则X可能是概念类而不是属性 If in doubt,make it a separate concept.Attributes should be fairly rare in a domain model.属性与外键 undesirable lbecause its purpose is to relate the Cashier

29、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 the relation until designlto avoid design creep(creep,not anticipated near the start)数量与单位Most numeric quantities should not be repre

30、sented as plain numbers.lprice or velocity 速度lThese are quantities with associated units,Solution(In the general case,)lrepresent Quantity as a distinct conceptual class,with an associated UnitQuantities are considered data types(unique identity of instances is not important)lit is acceptable to col

31、lapse their illustration into the attribute section of the class box解决相似概念A thing that records sales and payments,Register登记簿:la book that logged sales and payments.lcash register:收银机lAcquire a generalized meaning over time.POST:point-of-sale terminal.lIn computerese,a terminal is any end-point devi

32、ce 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-munication switch:Message,Connection,Port,Dialog,Route,Protocol.添加Specification/descriptionthe need for specification conceptual classes is common

33、in many domain models.规则:使用Specification/description的场合l当需要对Item或服务进行描述(独立于这些条目或服务当前存在的任何具体例子)时l删除实例会导致有用信息丢失时(这些信息和被删除的东西不恰当地关联在一起了)l要减少信息冗余common in sales,product,and manufacturing Domainsa ProductSpecification(or ItemSpecification,ProductDescription .)conceptual class records information about it

34、emsdoes not represent an Item,it represents a description of information about itemsit is common to state that an XSpecification Describes an X又一例(服务)电信套餐PackageDescription rates per minute wireless Internet content cost实际卖出去的套餐lgold package sold to XXX on Jan.1,2047 at$55 per month又一例(服务)航班失事,则取消所有

35、航班(service),所有Flight对象删除。则各个number的航班目的地信息全部丢失,应该把number部分提取出来同一种图可用于不同视角的模型Essential or conceptual perspectivel现实世界现实世界Specification perspectivel独立于语言的软件世界Implementation perspectivel具体语言实现解决语义鸿沟-用相同的名称representational gap or semantic gapClasslgeneral term lrepresenting either a real-world thing(a c

36、onceptual class)or software thing(a software class).Conceptual classlreal-world concept or thinglA conceptual or essential perspectivelThe UP Domain Model contains conceptual classes.Software classla class representing a specification or implementation perspective of a software component,regardless

37、of the process or method.Design classla member of the UP Design Modella synonym for software classleither a specification or implementation perspective,as desired by the modeler.Implementation classla class implemented in an object-oriented language such as Java.Report ObjectsInclude Receipt in the

38、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.赋予持有者退货的权利(return bought items)l本次迭代未考虑退货,因而不包括Receipt,处理Handle Returns的迭代中再考虑领域模型和UP初始-no

39、细化-l主要在此创建,当需要理解值得注意的概念,并映射到部分设计工作的类中l熟练者每次迭代只需几小时来开发领域模型,若是用预定义的分析模式,还将更快The UP Business Object Model vs.Domain ModelBusiness Object 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 bu

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

41、PgPdLaI6F3C0y)v&s#pXmUiRfNcK9H5E2B+x(u$rZoWkThQeMbJ7G4D1z-w*t!qYmVjSgOdLaI6F3B0y)v%s#pXlUiQfNcK8H5E2A+x*u$rZnWkThPeMaJ7G4C1z-w&t!qYmVjNcK9H5E2B+x(u$rZoWkThQeMbJ7G4D1z-w*t!qYmVjSgOdLaI6F3B0y)v%s#pXlUiQfNcK8H5E2A+x(u$rZnWkThPeMbJ7G4C1z-w&t!qYmVjRgOdL9I6F3B0y(v%s#oXlUiQfNbK8H5D2A+x*u$qZnWkShPeMaJ7F4C1z

42、)w&t!pYmUjRgOcL9I6E3B0y(v%r#oXlTiQfNbK8G5D2A-x*u$qZnVkShPdMaJ7F4C0z)w&s!pYmUjRfOcL9H6E3B+y(u%r#oWlTiQeNbJ8G5D1A-x*t$qZnVkSgPdMaI7F4C0z)v&s!pXmUjRfOcK9H6E2B+y(u%rZoWlThQeNbJ8G4D1A-w*t$qYnVjSgPdLaI7F3C0y)v&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OcK9H6E2B+x(u%rZoWlThQeMbJ8G4D1A&s!pXmUjRfOcL9H6E3B+y(u%r#oWlTiQeNbJ8G5D1A-x*t$qYnVkSgPdMaI7F3C0z)v&s!pXmUiRfOcK9H6E2B+x(u%rZoWlThQeMbJ8G4D1A-w*t!qYnVjSgPdLaI7F3C0y)v&s#p

50、XmUiRJ8G5D1A-x*t$qYnVkSgPdMaI7F3C0z)v&s!pXmUiRfOcK9H6E2B+x(u%rZoWlThQeNbJ8G4D1A-w*t$qYnVjSgPdLaI7F3C0y)v&s#pXmUiRfNcK9H5E2B+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

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公、行业 > 各类PPT课件(模板)
版权提示 | 免责声明

1,本文(领域模型概念的可视化53课件.ppt)为本站会员(晟晟文业)主动上传,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
2,用户下载本文档,所消耗的文币(积分)将全额增加到上传者的账号。
3, 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(发送邮件至3464097650@qq.com或直接QQ联系客服),我们立即给予删除!


侵权处理QQ:3464097650--上传资料QQ:3464097650

【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。


163文库-Www.163Wenku.Com |网站地图|