软件工程概论课件面向对象01conceptsofoo_第1页
软件工程概论课件面向对象01conceptsofoo_第2页
软件工程概论课件面向对象01conceptsofoo_第3页
软件工程概论课件面向对象01conceptsofoo_第4页
软件工程概论课件面向对象01conceptsofoo_第5页
已阅读5页,还剩55页未读 继续免费阅读

下载本文档

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

文档简介

1、Objectives:ConceptsofObjectObjectives:ConceptsofObjectDefinethebasicconceptsandtermsobjectionandtheted2Unified ing象 一Unified ing象 一种图形化了的语言,主要用图形方式表 一种开放的标发展1997年确立的OMG(Object Management Group)标2003版2004年预3UML的特可视UML的特可视标象4UML的应UML开发中的可视化说明UML的应UML开发中的可视化说明建造建档)UML是一个通用的标准建模静态结构建动态行为建不法,它独立于可遵循任何类型的

2、建模5Review:Why?ing achieves four HelpsyoutoReview:Why?ing achieves four HelpsyoutovisualizeasystemasyouwantittoPermitsyoutospecifythestructureorbehaviorofa Givesyouatemplate tguidesyouinconstructingsthesyouhaveYoubuildsofcomplexsystemsyoucannotcomprehendsuchasysteminits You build m youaredevelostobet

3、terunderstandthe.6FourPrinciplesofTheyoucreatehowproblemFourPrinciplesofTheyoucreatehowproblemisEverymaybeexpressedatlevelsof.ThebestsareconnectedtoNosinglei7Review:BasicPrinciplesofObject8Review:BasicPrinciplesofObject8Review:Course Offering (9:00 AM, Course(e.g.,9Review:Course Offering (9:00 AM, C

4、ourse(e.g.,9Review:EncapsulationProfessor Clark needstobeable to teach fourProfessor nextReview:EncapsulationProfessor Clark needstobeable to teach fourProfessor nextName: J Clark Employee ID: HireDate: Sus:Discipline: MaxLoad: Review:le:Forle,complexsystems smaller modules.oReview:le:Forle,complexs

5、ystems smaller modules.oCourseRegistration Review:le:BeElementsatReview:le:BeElementsatthesameleveloftheshouldbeatthesamelevelUML的捕获需求内(用于需求分析捕获逻辑结描述类的定义以及类间的描述某一时刻的捕获行(用于分析,设 UML的捕获需求内(用于需求分析捕获逻辑结描述类的定义以及类间的描述某一时刻的捕获行(用于分析,设 描述一个对象的描述工作流和事件流以及捕获实现执行(用于设计 UML可视化建类用例对象构件部UML可视化建类用例对象构件部署活动协作用例用例用例图的模

6、型元参与者描述系统外部元素所用用例图的模型元参与者描述系统外部元素所用例参与者关联提供用例与参与者间的系统边用例图实网上购物系用例图实网上购物系统用例题:试画用例例题:试画用例需要描存款人新设一个存款人查询剩余存款人存款人例题:试画用例图例题:试画用例图(题解Review:WhatIsanAnobjectisanwell-Review:WhatIsanAnobjectisanwell-boundaryandtencapsulatesandeSeisrepresentedattributesand Behavior is represented by operations, methods,an

7、deReview:WhatIsaAclassisadescriptionReview:WhatIsaAclassisadescriptionofasetofobjects share the same attributes, operations,relationships,andAnobjectisaninstanceofaAclass is hat EmphasizesrelevantSuppressesother类描述各个类类描述各个类本身描述系统中类之间的各种静态结描述系统的静态结构,而不是系统Review:RepresentingheAclassisReview:Representi

8、ngheAclassisrepresentedusingarectangleProfessorJ类的表示类类属性的语法为属性类的表示类类属性的语法为属性名:类型=缺省值约束特性可见类操作的语法为可见操作名(参数表):返回约束特性属性1属性2属性操作操作Review:TheRelationshipnClassesandAclass is Review:TheRelationshipnClassesandAclass is definition ofanItdefinesthestructureandbehaviorofeachobjectin the class.Itservesasatempl

9、ateforcreatingClasses are notcollections of Professor Professor rofessor 类的表示实员可见初始+public 所有的类类的表示实员可见初始+public 所有的类-private只有自己员返回值类():(:String参数 工龄= 退=类图的模型元类角属性操作名类图的模型元类角属性操作名属性操作名角色角色关多重泛对象类图的在对象名下面要所使用的符号与类图对象类图的在对象名下面要所使用的符号与类图基本Review:Class“TheGradyconnectionnClassReview:Class“TheGradyconne

10、ctionnClassdiagramsmayconta heWhatIst it sible to navigate ting classWhatIst it sible to navigate ting class to sing Review:WhatIsanThe relationship n two more Review:WhatIsanThe relationship n two more t specifies amongtheirAstructuralrelationship,tobjectsofthingareconnectedtoobjectsof关使用关联表示对象之间具关

11、可以关使用关联表示对象之间具关可以用箭头考大报考Review:WhatIsMultiplicityisthenumberofonerelatesReview:WhatIsMultiplicityisthenumberofonerelatestoONEinstanceofanotherForeachtion,therearetwostomake,oneforeachendofForeachinstanceofProfessor,manyCourse Offerings may be taught.ForeachinstanceofCourseOffering,theremaybe either

12、one or zero Professor as the instructor.+角色和多重角色名,表示一个类对于对角色和多重角色名,表示一个类对于对方类来说自己扮演的角色或考大考报考志愿学多重性,表示相关联的类之间,对象数目Review:MultiplicityExactly Zero or Review:MultiplicityExactly Zero or Zero or One or Zero or One(optionalscalarSpecified Multiple, 2, Review:WhatIsAn aggregation is a l form ofReview:What

13、IsAn aggregation is a l form of nt s a whole-part relationship anaggregate(thewhole)anditsAnaggregationisan“Isapart-of”Multiplicityis represented like other 1用的关表示类之间的关系是整体与部用的关表示类之间的关系是整体与部分的表示,菱形在整体WhatIsAitionisastrongerformtioninwhichtheWhatIsAitionisastrongerformtioninwhichtheitehasresponsibili

14、tyformanagingitspartssuch as their allocation and deallocation.Itisshownbyadiamondfilledontheite1(不可共享WhatisaStructuredAstructuredclasscontainspartsWhatisaStructuredAstructuredclasscontainspartsort form its structure and realize itsDescribesernal ion Thepartsthemselvesmayalso structured classesAllow

15、shierarchicalstructuretopermitaofmultilevelAconnectorisusedtorepresenttioninaparticularRepresents communications paths among StructuredoApartorroleisStructuredoApartorroleisshownbyusingthesymbol for a class (a rectangle) with the syntax:rolename :Typename multiplicity AllthreemaybeIfmultiplicity is

16、omitted, itdefaults to A reference to an external object (one not ownedbytheenclosingobject)isshownby a dashed rectangle.ClassDiagramversusStructureStructure Class11ClassDiagramversusStructureStructure Class11le:StructureCourseRegistration:le:StructureCourseRegistration:Review:WhatIsA relationship a

17、mong classes where one classsharestheReview:WhatIsA relationship among classes where one classsharesthestructureand/orbehavior of one or more classesDefinesahierarchyionsinasubclassinheritsfromoneormore Single Multiple Isan“isakindof”泛泛Relationships: Arelationshipbet where a change i the otherntwoem

18、aycauseachange-structural, “using” Relationships: Arelationshipbet where a change i the otherntwoemaycauseachange-structural, “using” CrRelationships: One classifier serves as the contract classifieragreestoca ryout,foundbetttheRelationships: One classifier serves as the contract classifieragreestoc

19、a ryout,foundbetttheandthetrealizeUsecasesandthetrealizeWhatIsPolymorphism多TheabilitytohideWhatIsPolymorphism多TheabilitytohidemanyionsbehindaManufacturer Manufacturer ManufacturerOOPrinciple: RemoteWhatIsAdeclarationofacoherentsetofpublicfeatures and obligations.AcontractnWhatIsAdeclarationofacohere

20、ntsetofpublicfeatures and obligations.Acontractnprovidersandconsumers. leserface-ttheesto erface-ttheelement vironment inrequiresfromotherelementsinordertobeabletoofferitsfullsetofprovided 接只具有操作的功能,不具有属性接只具有操作的功能,不具有属性,关联,操和类一样用四角形来表示实例,使erface的构类接erface (实现关系A Elided/Iconic (省略/标志性的Remoteical (规范的

21、Manufacturererface (实现关系A Elided/Iconic (省略/标志性的Remoteical (规范的Manufacturererface(依赖关系le: A Remoteerface(依赖关系le: A RemoteRemoteManufacturerRemoteManufacturer包- 模型元素分组的一种机包- 模型元素分组的一种机目通过分组,可提高模型的维持包包(客户端包包(提供者Whatisa(端口与封装体AportisastructuraltWhatisa(端口与封装体AportisastructuralteractioncontentsofaclassandPortbehaviorisspecifiedbyitsprovidedPermitsernalstructuretobewithoutaffectingexternalExternalnts have no visibility AclassmayhaveanumberofEachsasetofprovidedandPortAportisshownPortAportisshownasasmallsquarewithename placed

温馨提示

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

评论

0/150

提交评论