资源描述:
《关于vfp的面相对象简介》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、Aquickintroductiontoobject-orientedprogrammingThefirstthingtounderstandaboutOOPisthatthereisnosinglewaytodoanyofthis.Ifyouwanderthehallsofaconferenceonobject-orientedprogramming,you’llhearallofthebuzzwordsandcatchphrases—andthenfinddifferentpeopleusingthe
2、mtomeandifferentthingsaccordingtocontext,language,andplatform.Onceyougetpastthatshockyou’llencounteravarietyofpeople—fromthepragmatists,thosewhohavetoimplementreal-worldsolutionstoday,tothetheorists,whosemissioninlifeistoevangelizeaboutPOOP—ProperObject-O
3、rientedProgramming.It’smuchliketheRelationalDatabaseManagementSystempuristswhoclaimthattoday,in1999,therestillisn’ta“true”relationaldatabasesystemcommerciallyavailable.Allalong,however,we’vebeenbuildingnormalizeddatastructures,makingdowiththeavailabletool
4、s,andrunningglobalbusinesseswiththesesystems.WhilewemayneverreachtheHolyGrailofOOP,wecangiveitourbestshotandget80%ofthebenefitswith20%oftheworry.Thus,asaresult,thediscussionthatfollowswon’tnecessarilywinany“POOP”awardsorputmeintheOOPHallofFame.Thisismytak
5、eonOOPasitrelatestoVisualFoxPro,atthisstageinthelifecycleofVFP.I’vebeenusingandlearningVisualFoxProOOPoverthepastfiveyears,andit’sstartingtosinkin.I’veevenshippedanapplicationortwo.Thischapterwillgiveyouthefundamentals.In20minutes,you’llunderstandwhatyoun
6、eedtoknowtotakeadvantageofVFP’sOOPcapabilities.Onceyou’recomfortablewiththecontentsofthischapter,youmaywanttoinvestigateMarkusEgger’sbook,AdvancedObjectOrientedProgrammingwithVisualFoxPro6.0(HentzenwerkePublishing).Thereareadozenormorefancybuzzwordsattach
7、edtotheOOPmodel,includingclass,object,property,method,inheritance,hierarchy,encapsulation,polymorphism,subclass,andsoon.Inmymind,thekeyconceptsthatwillbringyouimmediatebenefitsaresubclassingandinheritance.TheoriginalformandcontrolobjectsVisualFoxProcomesw
8、ithadefaultformobjectthatisusedasastartingpointeverytimeyoucreateanewform.Ithasagraybackground,measuresabout360pixelswideby240pixelshigh,hasasystem-typeborder,isnamed“Form1”andhasacaptionof“Form1.”Additionally,VFPco