版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Object-OrientedTechnology
Unit6TextA
Contents
NewWords
Abbreviations
Phrases课文讲解NewWordsNewWordsNewWordsNewWordsPhrasesPhrasesAbbreviationsStudyofKeyNewWordsStudyofKeyNewWordsStudyofKeyNewWordsStudyofKeyNewWordsStudyofKeyPhrases
StudyofKeyPhrases
StudyofKeyPhrases
StudyofKeyAbbreviationsListeningtoTextAnalysisofDifficultSentencesAnalysisofDifficultSentencesAnalysisofDifficultSentencesAnalysisofDifficultSentencesAnalysisofDifficultSentencesObject-OrientedTechnology1.Object-OrientedAnalysisObject–OrientedAnalysis(OOA)istheprocedureofidentifyingsoftwareengineeringrequirementsanddevelopingsoftwarespecificationsintermsofasoftwaresystem’sobjectmodel,whichcomprisesofinteractingobjects.英
文面向对象技术1.面向对象的分析面向对象分析(OOA)是根据软件系统的对象模型(包括交互对象)识别软件工程需求并制定软件规范的过程。中
文课文讲解Themaindifferencebetweenobject-orientedanalysisandotherformsofanalysisisthatinobject-orientedapproach,requirementsareorganizedaroundobjects,whichintegratebothdataandfunctions.Theyaremodelledafterreal-worldobjectsthatthesysteminteractswith.Intraditionalanalysismethodologies,thetwoaspects----functionsanddata----areconsideredseparately.英
文面向对象的分析与其它形式的分析之间的主要区别在于,在面向对象的方法中,需求是围绕对象组织的,这些对象集成了数据和功能。它们根据与系统交互的实际对象建模。在传统的分析方法中,功能和数据这两个方面是分开考虑的。中
文课文讲解Theprimarytasksinobject-orientedanalysis(OOA)are:●Identifyingobjects.●Organizingtheobjectsbycreatingobjectmodeldiagram.●Definingtheinternalsoftheobjects,orobjectattributes.●Definingthebehavioroftheobjects,i.e.,objectactions.●Describinghowtheobjectsinteract.ThecommonmodelsusedinOOAareusecasesandobjectmodels.英
文面向对象分析(OOA)的主要任务是:●识别对象。●通过创建对象模型图来组织对象。●定义对象或对象属性的内部。●定义对象的行为,即对象动作。●描述对象相互作用的方式。OOA中使用的常见模型是用例和对象模型。中
文课文讲解2.Object-OrientedDesignObject–OrientedDesign(OOD)involvesimplementationoftheconceptualmodelproducedduringobject-orientedanalysis.InOOD,conceptsintheanalysismodel,whicharetechnology−independent,aremappedontoimplementingclasses,constraintsareidentifiedandinterfacesaredesigned,resultinginamodelforthesolutiondomain.英
文2.面向对象设计面向对象设计(OOD)涉及实施在面向对象分析过程中产生的概念模型。在OOD中,分析模型中的概念与技术无关,它们被映射到实现类上,确定约束并设计接口,从而形成解决方案中的模型。中
文课文讲解Theimplementationdetailsgenerallyinclude:●Restructuringtheclassdata(ifnecessary).●Implementationofmethods,i.e.,internaldatastructuresandalgorithms.●Implementationofcontrol.●Implementationofassociations.英
文实施细节通常包括:●重组类数据(如有必要)。●方法的实现,即内部数据结构和算法。●实施控制。●实现关联。中
文课文讲解3.Object-OrientedProgrammingObject-orientedprogramming(OOP)isaprogrammingparadigmbaseduponobjects(havingbothdataandmethods)thataimstoincorporatetheadvantagesofmodularityandreusability.Objects,whichareusuallyinstancesofclasses,areusedtointeractwithoneanothertodesignapplicationsandcomputerprograms.英
文3.面向对象编程面向对象编程(OOP)是一种基于对象(具有数据和方法)的编程范式,旨在融合模块化和可重用性的优点。对象通常是类的实例,用于彼此交互以设计应用程序和计算机程序。中
文课文讲解Theimportantfeaturesofobject–orientedprogrammingare:●Bottom–upapproachinprogramdesign.●Programsorganizedaroundobjects,groupedinclasses.●Focusondatawithmethodstooperateuponobject’sdata.●Interactionbetweenobjectsthroughfunctions.●Reusabilityofdesignthroughcreationofnewclassesbyaddingfeaturestoexistingclasses.Someexamplesofobject-orientedprogramminglanguagesareC++,Java,Smalltalk,Delphi,C#,Perl,Python,Ruby,andPHP.英
文面向对象编程的重要特征是:●程序设计中的自下而上的方法。●围绕对象组织的程序,按类分组。●以处理对象数据的方法聚焦数据。●以功能进行对象之间的交互。●以向现有类添加功能来创建新类来实现设计的可重用性。面向对象编程语言的有以下示例:C++、Java、Smalltalk、Delphi、C#、Perl、Python、Ruby和PHP。中
文课文讲解4.ObjectsandClasses4.1ObjectAnobjectisareal-worldelementinanobject–orientedenvironmentthatmayhaveaphysicaloraconceptualexistence.Eachobjecthas:●Identitythatdistinguishesitfromotherobjectsinthesystem.●Statethatdeterminesthecharacteristicpropertiesofanobjectaswellasthevaluesofthepropertiesthattheobjectholds.●Behaviorthatrepresentsexternallyvisibleactivitiesperformedbyanobjectintermsofchangesinitsstate.英
文4.对象和类4.1对象对象是面向对象的环境中的现实世界元素,可能在物理上或概念上是存在的。每个对象都具有:●标识:使其与系统中其它对象区分开。●状态:确定对象的特征属性以及该对象拥有的属性值。●行为:表示在状态变化时对象所进行的外部可见活动。中
文课文讲解Objectscanbemodelledaccordingtotheneedsoftheapplication.Anobjectmayhaveaphysicalexistence,likeacustomer,acar,etc.;oranintangibleconceptualexistence,likeaproject,aprocess,etc.4.2ClassAclassrepresentsacollectionofobjectshavingsamecharacteristicpropertiesthatexhibitcommonbehavior.Itgivestheblueprintordescriptionoftheobjectsthatcanbecreatedfrom.Creationofanobjectasamemberofaclassiscalledinstantiation.Thus,objectisaninstanceofaclass.英
文可以根据应用程序的需求对对象建模。一个对象可能具有物理存在(例如客户、汽车等)或无形的概念性存在(例如项目、过程等)4.2类类表示具有相同特征的对象的集合,这些对象具有共同的行为。它给出了可以从中创建对象的蓝图或描述。创建作为类成员的对象称为实例化。因此,对象是类的实例。中
文课文讲解Theconstituentsofaclassare:●Asetofattributesfortheobjectsthataretobeinstantiatedfromtheclass.Generally,differentobjectsofaclasshavesomedifferenceinthevaluesoftheattributes.Attributesareoftenreferredtoasclassdata.●Asetofoperationsthatportraythebehavioroftheobjectsoftheclass.Operationsarealsoreferredtoasfunctionsormethods.英
文类的组成部分包括:●将从类中实例化的对象的一组属性。通常,类的不同对象在属性值上有一些差异。属性通常称为类数据。●描述类对象行为的一组操作。操作也称为功能或方法。中
文课文讲解Letusconsiderasimpleclass,Circle,thatrepresentsthegeometricalfigurecircleinatwo–dimensionalspace.Theattributesofthisclasscanbeidentifiedasfollows:●x–coord,todenotex–coordinateofthecenter●y–coord,todenotey–coordinateofthecenter●a,todenotetheradiusofthecircle英
文让我们考虑一个简单的类Circle,它代表二维空间中的几何图形圆。此类的属性可以标识如下:●x坐标,表示中心的x坐标●y坐标,表示中心的y坐标●a,表示圆的半径中
文课文讲解Someofitsoperationscanbedefinedasfollows:●findArea(),methodtocalculatearea●findCircumference(),methodtocalculatecircumference●scale(),methodtoincreaseordecreasetheradius英
文其某些操作可以定义如下:●findArea(),用于计算面积的方法●findCircumference(),用于计算周长的方法●scale(),增加或减少半径的方法中
文课文讲解Duringinstantiation,valuesareassignedforsomeoftheattributes.Ifwecreateanobjectmy_circle,wecanassignvalueslikex-coord:2,y-coord:3,anda:4todepictitsstate.Now,iftheoperationscale()isperformedonmy_circlewithascalingfactorof2,thevalueofthevariableawillbecome8.Thisoperationbringsachangeinthestateofmy_circle,i.e.,theobjecthasexhibitedcertainbehavior.英
文在实例化期间,为某些属性分配值。如果创建对象my_circle,则可以分配值,如x-coord:2,y-coord:3和a:4来描述其状态。现在,如果在比例缩放因子为2的my_circle上执行了scale()操作,则变量a的值将变为8。此操作将改变my_circle的状态,即对象已表现出一定的行为。中
文课文讲解5.EncapsulationandDataHiding5.1EncapsulationEncapsulationistheprocessofbindingbothattributesandmethodstogetherwithinaclass.Throughencapsulation,theinternaldetailsofaclasscanbehiddenfromoutside.Itpermitstheelementsoftheclasstobeaccessedfromoutsideonlythroughtheinterfaceprovidedbytheclass.英
文5.封装和数据隐藏5.1封装封装是将属性和方法绑定到类中的过程。通过封装,可以对外部隐藏类的内部细节。它允许仅通过类提供的接口从外部访问类的元素。中
文课文讲解5.2DataHidingTypically,aclassisdesignedsuchthatitsdata(attributes)canbeaccessedonlybyitsclassmethodsandinsulatedfromdirectoutsideaccess.Thisprocessofinsulatinganobject’sdataiscalleddatahidingorinformationhiding.IntheclassCircle,datahidingcanbeincorporatedbymakingattributesinvisiblefromoutsidetheclassandaddingtwomoremethodstotheclassforaccessingclassdata,namely:英
文5.2数据隐藏通常,对一个类进行设计,以便只能通过其类方法访问其数据(属性),并且避免外部直接访问。这个隔离对象数据的过程称为数据隐藏或信息隐藏。在类Circle中,可以通过以下方式融入数据隐藏:使属性从类外部不可见,并向该类添加另外两种方法以访问类数据,即:中
文课文讲解Heretheprivatedataoftheobjectmy_circlecannotbeaccesseddirectlybyanymethodthatisnotencapsulatedwithintheclassCircle.ItshouldinsteadbeaccessedthroughthemethodssetValues()andgetValues().●setValues(),methodtoassignvaluestox-coord,y-coord,anda●getValues(),methodtoretrievevaluesofx-coord,y-coord,anda英
文●setValues(),将值分配给x坐标、y坐标和a的方法●getValues(),用于获得x坐标、y坐标和a值的方法在这里,对象my_circle的私有数据无法通过未封装在Circle类中的任何方法直接访问。相反,应通过setValues()和getValues()方法进行访问。中
文课文讲解6.MessagePassingAnapplicationrequiresanumberofobjectsinteractinginapropermanner.Objectsinasystemmaycommunicatewitheachotherusingmessagepassing.Supposeasystemhastwoobjects:obj1andobj2.Theobjectobj1sendsamessagetoobjectobj2,ifobj1wantsobj2toexecuteoneofitsmethods.英
文6.消息传递应用程序需要以适当方式进行交互的多个对象。系统中的对象可以使用消息传递相互通信。假设系统有两个对象:obj1和obj2。如果obj1希望obj2执行其某个方法,则对象obj1向对象obj2发送一条消息。中
文课文讲解Thefeaturesofmessagepassingare:●Messagepassingbetweentwoobjectsisgenerallyunidirectional.●Messagepassingenablesallinteractionsbetweenobjects.●Messagepassingessentiallyinvolvesinvokingclassmethods.●Objectsindifferentprocessescanbeinvolvedinmessagepassing.英
文消息传递的特点包括:●在两个对象之间传递的消息通常是单向的。●消息传递使对象之间的所有交互成为可能。●消息传递主要涉及调用类方法。●消息传递中可能涉及不同进程中的对象。中
文课文讲解7.InheritanceInheritanceisthemechanismthatpermitsnewclassestobecreatedoutofexistingclassesbyextendingandrefiningitscapabilities.Theexistingclassesarecalledthebaseclasses/parentclasses/superclasses,andthenewclassesarecalledthederivedclasses/childclasses/subclasses.Thesubclasscaninheritorderivetheattributesandmethodsofthesuperclass(es)providedthatthesuperclassallowsso.Besides,thesubclassmayadditsownattributesandmethodsandmaymodifyanyofthesuperclassmethods.Inheritancedefinesan“is–a”relationship.英
文7.继承继承是一种机制,可以通过扩展和完善其功能从现有类中创建新类。现有类称为基类/父类/超类,新类称为派生类/孩子类/子类。只要超类允许,子类可以继承或派生超类的属性和方法。此外,子类可以添加自己的属性和方法,并且可以修改任何超类方法。继承定义了“是——一个”的关系。中
文课文讲解FromaclassMammal,anumberofclassescanbederivedfrom,suchashuman,cat,dog,cow,etc.Humans,cats,dogs,andcowsallhavethedistinctcharacteristicsofmammals.Inaddition,eachhasitsownparticularcharacteristics.Itcanbesaidthatacow“is–a”mammal.Typesofinheritance:●Singleinheritance−Asubclassderivesfromasinglesuperclass.●Multipleinheritance−Asubclassderivesfrommorethanonesuperclasses.英
文从哺乳动物类中,可以衍生出许多类,例如人、猫、狗、牛等。人、猫、狗和牛都具有哺乳动物的独特特征。此外,每种动物都有其自己的特定特征。可以说,牛是“哺乳动物”。继承类型:●单一继承——一个子类派生自单个超类。●多重继承——一个子类派生自一个以上的超类。中
文课文讲解●Multilevelinheritance−Asubclassderivesfromasuperclasswhich,inturn,isderivedfromanotherclassandsoon.●Hierarchicalinheritance−Aclasshasanumberofsubclasses,eachofwhichmayhavesubsequentsubclasses,continuingforanumberoflevels,soastoformatreestructure.●Hybridinheritance−Acombinationofmultipleandmultilevelinheritancesoastoformalatticestructure.英
文●多级继承——一个子类从超类派生,而超类又从另一个类派生,依此类推。●层次继承——一个类具有多个子类,每个子类可能具有后续的子类,并连续多个级别,以形成树结构。●混合继承——多重继承和多级继承的组合,以形成网格结构。中
文课文讲解8.PolymorphismPolymorphismisoriginallyaGreekwordthatmeanstheabilitytotakemultipleforms.Inobject-orientedparadigm,polymorphismimpliesusingoperationsindifferentways,dependingupontheinstancetheyareoperatingupon.Polymorphismallowsobjectswithdifferentinternalstructurestohaveacommonexternalinterface.Polymorphismisparticularlyeffectivewhileimplementinginheritance.英
文8.多态多态性最初是一个希腊词,表示能够具有多种形式。在面向对象的范例中,多态性意味着以不同的方式使用操作,具体取决于操作所基于的实例。多态性允许具有不同内部结构的对象具有共同的外部接口。多态在实现继承时特别有效。中
文课文讲解Letusconsidertwoclasses,CircleandSquare,eachwithamethodfindArea().Thoughthenameandpurposeofthemethodsintheclassesaresame,theinternalimplementation,i.e.,theprocedureofcalculatingareaisdifferentforeachclass.WhenanobjectofclassCircleinvokesitsfindArea()method,theoperationfindstheareaofthec
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026事业单位工勤技能-广东-广东地质勘查员三级(高级工)历年参考题库含答案详解3套试卷
- 2026事业单位工勤技能-山西-山西计算机信息处理员一级高级技师历年参考题库含答案详解3套试卷
- 2026事业单位工勤技能-山西-山西家禽饲养员三级(高级工)历年参考题库含答案详解3套试卷
- 2026事业单位工勤技能-山东-山东电工一级(高级技师)历年参考题库含答案详解3套试卷
- 2026事业单位工勤技能-四川-四川水工闸门运行工二级(技师)历年参考题库含答案详解3套试卷
- 2026事业单位工勤技能-吉林-吉林水生产处理工二级(技师)历年参考题库含答案详解3套试卷
- 2025年航空航天科普知识竞赛题库及一套完整答案
- 2026事业单位工勤技能-云南-云南汽车修理工(技师-高级技师)历年参考题库含答案详解3套试卷
- 2025海洋科普知识赛题真题试卷
- 2026年四川省广元市重点学校初一入学数学分班考试试题及答案
- 2026中信证券福建分公司校园招聘笔试历年典型考题及考点剖析附带答案详解
- 2026年中国资源循环集团绿色纤维有限责任公司招聘(13人)笔试备考题库及答案详解
- 绵阳东辰聚星中学2025初一入学数学分班考试真题含答案
- 2025年浙江省事业单位统考综合应用能力试题及答案
- 2026人教版六年级数学上册第四单元第3课《圆的周长(1)》教案
- 中医妇科护理的未来发展方向
- 中国创伤中心建设与管理指南2025版
- 《眼镜营销与眼镜店管理》课件-第二章 眼镜产品策略
- 2026新疆水利水电勘测设计研究院有限责任公司及所属子公司社会招聘21人农业笔试备考题库及答案解析
- 把“故乡与小时候”写成文24招-2026年中考语文二轮复习
- 2026年大气科学硕士考研复试高频面试题包含详细解答
评论
0/150
提交评论