面向对象中外文翻译.docx

上传人:b****7 文档编号:25403392 上传时间:2023-06-08 格式:DOCX 页数:18 大小:26.76KB
下载 相关 举报
面向对象中外文翻译.docx_第1页
第1页 / 共18页
面向对象中外文翻译.docx_第2页
第2页 / 共18页
面向对象中外文翻译.docx_第3页
第3页 / 共18页
面向对象中外文翻译.docx_第4页
第4页 / 共18页
面向对象中外文翻译.docx_第5页
第5页 / 共18页
点击查看更多>>
下载资源
资源描述

面向对象中外文翻译.docx

《面向对象中外文翻译.docx》由会员分享,可在线阅读,更多相关《面向对象中外文翻译.docx(18页珍藏版)》请在冰豆网上搜索。

面向对象中外文翻译.docx

面向对象中外文翻译

 

 

学院(部):

计算机科学与工程学院

专业班级:

计算机09-2班

学生姓名:

指导教师:

2013年5月29日

 

Object-orientedanalysisanddesign

Thebasicconceptofobject-orientedtechnologyandthebasicmethod

1.1softwaredevelopmentmethod

Computerafterbirth,computertechnologyhasbeendevelopinginhighspeedcondition,thedevelopmentofcomputerscienceandtechnologybyoriginalonlydependsonthedevelopmentofhardwaretorelyingmoreonsoftwaredevelopment.Infact,thedevelopmentofsoftwaretechnologyhasexperiencedmorethangenerationprocess.

Firstgeneration(50to60softhe20thcentury),inprogramminglanguagessuchasFORTRANandALGOLtechnologymarkedbyalgorithm

Generationtogeneration.Atthattime,theprogramdesignonpeopleallcreativetalents,allrelyontipsandtricks.Softwareproductivityisverylow,basedonthealgorithmprocedureisverydifficulttounderstand,programmerswritetheirownprogramoveraperiodoftimeevenafteroneselfalsolooknottounderstand,thistothesoftwaremodifications,maintenancebringgreatdifficulties.Soattheendofthe60sinthe"softwarecrisis".

Secondgeneration(inthelate1970sto80sprevailing),suchasPASCAL,andCOBOLprogramminglanguageandrelationaldatabasemanagementsystemforastructuredsystemanalysisanddesigntechniques.Inordertoovercomethesoftwarecrisis,peoplemadeeffortstomainlyfromthefollowingtwodirections:

MethodsfromtheAngleofthemanagementtoimprovethesoftwaredevelopment,softwareengineeringmethodisproposed,andgreatlyimprovethequalityandmaintainabilityofthesoftware.

Secondistofocusontheanalysisinthesoftwaredevelopmentprocessanddesignmethodofresearchandimprovement.Importantachievementsinthisfieldisdevelopedinthe70stherageofstructureddevelopmentmethodofstructuredsystemanalysisanddesigntechniques.

Thirdgeneration(inthe80sisstillprevalent)representedbySmalltalk,c++object-orientedsoftwaredevelopmentmethods.

Question1:

whatisonthedevelopmentdynamicsofobject-orientedsoftwaredevelopmentmethods?

Traditionalstructuredprogrammingalgorithmasthecore,theoriginaliscloselyrelatedtothedataandseparatetotheoperationofthedata,itisdifficulttomaintaintheconsistencyofdataandoperation,itssoftwaredevelopmentmethodalsodoesnotconformtothenaturalthinkinghabits,thedesignedsoftwaresystemsolutionspaceandtheproblemspace,theexpanded,difficulttounderstand,modify,andleadtoproblemsintermsofprogramcomplexityandsoftwarecrisis.Inordertotranscendprogramcomplexitybarrier,overcomethesoftwarecrisis,object-orientedsoftwaredevelopmentmethodsareputforward.

Question2:

whataretheadvantagesoftheobject-orientedsoftwaredevelopmentmethod?

Object-orienteddevelopmentmethodtochangethepasttraditionalonthebasisoffunctionanalysisandfunctiondecompositionofprocessorientedstructuralanalysisanddesignmethodofobject-orienteddevelopmentmethodtosimulatethewaypeopleunderstandanddealwiththeobjectiveworldtoanalyzetheproblem,thesystemasaseriesofcollectionsofobjects,itsobject-orienteddesignandanalysisofresultsismappedtoastructureofobject-orientedimplementationtool,hasamoredirectcorrespondencetomappingprocess,theanalysts,designers,andprogrammerscanusethesameconcept,sothattheobjectorientedsoftwaredevelopmentcansimulatemorenaturallytotheactivitiesoftheobjectiveworld,makingtheproblemspaceandsolutionspaceonthestructureassoonaspossible.Therefore,adoptingtheobject-orientedmethodcanmoreeffectivelydevelopinglargesoftwaresystems.Object-orientedmethodofencapsulation,inheritanceandpolymorphismmechanismnotonlytosupportsoftwarereuse,andthesoftwaremaintenance,reliableandefficientsoftwaresystemwhichcanrealizeflexiblemanufacturing,bettertoovercomethesoftwarecrisis.Therefore,ithasbecomeamaturemethodwidelyusedinsoftwaredevelopment.Bytheendofthe20thcentury,objectorientedsoftwareengineeringdevelopmentgraduallymature,especiallytheformationoftheunifiedmodelinglanguage(UML)standardandwidelyused,theobject-orientedsoftwaredevelopmentmethodshavebecomethemainstreamofthesoftwaredevelopmenttechnology.

1.2thebasicconceptofobject-oriented

Object:

(1)abstractrepresentationsoftheobjectsisanobjectiveentityattributesoftheobjectisdescribedbythedataandthedatafortheoperationofthebehavioroftwoparts.

(2)class:

classisacollectionofobjectswiththesamepropertiesandbehaviorofabstractdescription;Internalincludingattributesandbehavioroftwomainparts.

(3)example:

classesistohavethesamepropertiesandbehaviorofasetofabstractdescriptionsofobjects.Therefore,classescanbeusedasauser-definedtypeandcreatetheobjectmodel,andaccordingtothemodelcreatedbytheactualexampleofaspecificobjectisaclass,oftenreferredtoasexamples.

(4)themessage:

themessageistorequestanobjectitcontainsaprocessingoperationontheinstructioninformation.Essenceistotheoperationoftheobjectofaclassfunctioncall,thecalltoamethod.

Forexample,studentS1;S1.Thedisplay()isamessage.

Anewsgenerallyconsistsofthreeparts:

receivingamessageobjectname,theparametersofthefunctionname,function,operation.

(5)thethreebasiccharacteristicsofobject-orientedtechnology:

encapsulation,inheritance,andpolymorphism

(6)encapsulation:

theso-calledencapsulationistheobject'spropertiesandbehaviorcombinedintoasingleunit,totheoutsideworldcannotdirectlyaccessormodifythedataandcode,theoutsideworldonlythroughobjectprovidestheinterfacefunctiontochangetheattributesoftheobjectorobtainingdata,itisrealizedthemessageishidden.

(7)inheritance:

ifinadefinedontheclass,addsomespecialattributeoroperation,canformanewclass,thisclassisnotonlyinheritedtheformerallcharacteristicsofaclass,andwithnewfeatures,soasaspecialcaseoftheclassbefore,isinfrontofaclasstoinherit.Aclassknownastheparentclass,beforethenewclassiscalledasubclass.Throughinheritancerelationshipcanformatypehierarchy,calledinheritancestructure.

Polymorphism(8):

indifferentclasses,thesamefunctionnametorealizefunctionsofdifferentfunctionsavailable.Polymorphismsoftheadvantages:

high-levelcode(algorithm)writeitonlyonceandthelowercanbereusedformanytimes,canimprovetheprogrammingflexibilityandefficiency.

Object-orientedprogramming

1.threemajormechanismsofobjectorientedtechnology(characteristics):

(1)encapsulationmechanismandthedesignoftheclass:

theso-calledencapsulatedobjectattributedataandoperationmethodisallowedtobecombinedintoasingleunit,totheoutsideworldcannotdirectlyaccessormodifythedataandcode,theoutsideworldonlythroughobjectprovidestheinterfacefunctiontochangetheattributesoftheobjectorobtainingdata,itimplementsthemessagehidden;Inc++,classistosupportthedataencapsulationtool,allowingdesignclassdescriptionstoabstractasetwiththesamepropertiesandbehavioroftheobject,namelycanencapsulateasetofobjectsintheclassofcommonpropertiesandmethods.Thus,classisthetooltorealizedataencapsulation,objectistherealizationofdataencapsulation.Nopackage,noobject-orientedtechnology.

Classmemberstoaccesstheprincipleis:

(1)defineaclass,thedatamembersandmemberfunctionsisthedefaultaccessprivatemembers.

(2)amemberfunctioncanbedirectaccesstothemembersofthesamevariablesandcallstomembersofthesamefunction,neednotaddobjectnamebeforethefunctionname.(3)membersoftheprivateorprotectedmemberislimitedtothescopeoftheclassthatthebodyandtheclassmemberfunctions;Nonmemberfunctionsshouldbedefinedasaclassoffriendstoaccesstheprivatemembersofaclassmemberfunction.(4)membersofthepublicscopenotonlyincludestheclassbody,alsoincludestheuseoftheobjectwhichitbelongs.Canaccesstopublicmembersoutsideclass,butmustbebeforethemembernameplustheobjectname.

(2)theinheritancemechanismandderivedclassdefinition:

theso-calledinheritanceisallowedonanexistingclass,addsomespecialattributesoroperations,toderiveanewclass.Notonlycanthederivedclassinheritsabaseclassmember,andcandefinenewmember,socanbeasspecialclassofaclassbefore.Aclassknownastheparentclass,beforethenewclassiscalledasubclass.Throughinheritancerelationshipcanformatypehierarchy,calledinheritancestructure.InheritanceisoneoftheSharedpropertiesbetweenclassesandservicemechanism.

classperson//Thebaseclass

{protected:

charname[11];

charsex;

intage;

public:

person(){cout<<“person”<

~person(){cout<<“deleteperson”<

intGetage(){return20;}}

classStudent:

publicperson

{private:

charid[9];

floatscore;

public:

student(){cout<<“student”<

~student(){cout<<“deletestudent”<

floatGetScore{returnscore;}

}

voidF(person*q){ q->Getage(); }

voidmain()

{person*p;

students;

p=&s;

F(p);//p->Getage();

}

Theresults:

person

student

20

deletestudent

deleteperson

2.Thedefinitionofmechanismofpolymorphismandvirtualfunctions:

Polymorphismreferstotheclasshierarchyinthesameclassordifferentclasses,canusethesamefunctionnamedifferentoperatingfunctionality,whichyoucanusethesamecallwaytoinvokethesefunctionswiththesamenamewithdifferentfunction

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

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1