




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
附錄A外文翻譯—原文部分1.IntroductionWebapplicationdevelopmenthascomealongwaysincethebeginningoftheWorldWideWeb.Amyriadoftechnologiesandprogramminglanguagesarenowusedtobuildwebapplications,butbecauseofthewaytheWorldWideWebevolvedandbecauseofthespeedatwhichitdidsothesetechnologiesdidn’treallyhavetimetoevolveandcopewiththepace.Manyplayerstriedtocomeupwithdifferentandexotictechnologiestomainlyimprovetheuserexperienceandhelpdevelopersbuildfasterandmorepowerfulwebapplications.Someofthesetechnologieshaveplayedanimportantroleinwebdevelopmentbuthaveseenanimportantdropinusageoverthelastyears,likeJavaAppletsandMicrosoftSilverlight.Ontheotherhandmanytechnologieshaveevolvedfromsimpletoystopowerfulandimportantpartsoftodays’webecosystem,likeJavaScript,FlashandXML.ThewebenvironmenttodayusesHTMLandCSStopresentdatatousersandinteractionisaccomplishedviaJavaScript.Thesetechnologiesarecalled“front-end”or“client-side”technologies.Ontheotherhand,“back-end”or“server-side”technologiesrefertodatastorageandprocessingtechnologies.2.ProblemformulationFrontendandbackendtechnologiescometogethertobuildwebapplications,butbecausetheWorldWideWebhasevolvedatsuchafastpaceandbecausedevelopersneedtousearatherlargenumberoftechnologiestobuildjustasinglewebapplication,theresultoftheirworkisoftentimesdifficulttomaintainandfix.DeveloperscombineHTMLcodewithserversideprogramminglanguagestocreatedynamicwebpagesandapplicationsandthisleadstohighlyentangledandunmaintainablecode.Anotherproblemhasgrownoutofthefactthatwebtechnologiesareincreasinglyusedtobuildallsortsofcomplexapplications.Microsoftembraceswebtechnologiestoencouragedeveloperstobuildapplicationsforits’latestoperatingsystem,Windows8.Also,alotofframeworksexistthathelpwebdeveloperswriteapplicationsformobiledevices,likePhoneGapandAppceleratorTitanium.Evenmore,amobileoperatingsystemisintheworksanddevicesareexpectlaterthisyearthatuseswebtechnologiesentirelyforthedeveloperAPI(MozillaFirefoxOS).Forthesereasonsawebapplicationisgenerallycreatedbyawholeteamofspecializeddevelopers,eachworkingwiththeirfavoritetechnology,likeHTMLandCSSforthepresentationlayer,JavaScriptforclient-sideinteraction,PHP(orASP,Java,Python,Pearl,Ruby,etc.)forserver-sidelogicandMySQL(orOracleDatabase,MicrosoftSQLServer,etc.)fordatastorageandmanagement.Eachofthesespecialistneedstoworkwiththeircolleaguesinsuchawaythattheircodepiecesfitinsidetheoveralldesignoftheapplication.Forexample,theclient-side(datapresentation)developerneedstoaltertheHTMLandCSScodeinsuchawaythathedoesn’tbreaktheserver-sidedevelopers’codethatresidesinthesamefile.Also,whenadatabasedeveloperalterstheschemaforanapplicationtheserver-sidedevelopermayneedtochangealotofcodetomaketheapplicationwork.Theimportantthingtonotehereisthatthereisanacuteneedtoseparatepresentationfromlogicanddatastorageinanapplication.Therearesomeapplicationdesignparadigmsandpatternsthatoffersolutionstothisproblem,butthefocusnowadaysisontheMVCpattern.Inconductingtheresearchwehaveusedourexperienceisbuildingwebapplicationswithvarioussystemsandframeworksandwehavetriedtoidentifybothstrengthsandweaknessesofthesesystemswhileprovidingourownviewonhowthesepracticescouldbeimproved.Studiedframeworksandsystemsinclude:Symfony,CakePHP,CodeIgniterZendFramework,Laravel,FuelPHP,RubyonRailsandASP.NETMVC.3.TheMVCpatternandliteratureoverviewInthissectionwewillreviewthecurrentstatusoftheresearchinthisfieldandtakealookattheliteraturebehindtheMVCpattern,describingthemainfunctionalpartsofthepattern.TheMVCdesignpatternwasfirstenvisionedbyTrygveReenskauginthe1970sattheXeroxParc.Accordingtohim,“theessentialpurposeofMVCistobridgethegapbetweenthehumanuser'smentalmodelandthedigitalmodelthatexistsinthecomputer”.[1]Lateron,in1988,theMVCparadigmwasdescribedindetailbyKrasnerandPopeintheirarticle“Acookbookforusingthemodel-viewcontrolleruserinterfaceparadigminSmalltalk-80”,publishedintheJournalofObject-OrientedProgramming.Theystressoutthatthereareenormousbenefitstobehadifonebuildsapplicationswithmodularityinmind.“Isolatingfunctionalunitsfromeachotherasmuchaspossiblemakesiteasierfortheapplicationdesignertounderstandandmodifyeachparticularunitwithouthavingtoknoweverythingabouttheotherunits.”[2]Anapplicationisdividedintothreemaincategories:themodelofthemainapplicationdomain,thepresentationofdatainthatmodelanduserinteraction.[2]TheMVCpatternsplitsresponsibilitiesintothreemainrolesthusallowingformoreefficientcollaboration.[3]Thesemainrolesaredevelopment,designandintegration.Thedevelopmentroleistakenonbyexperiencedprogrammersthatareresponsibleforthelogicoftheapplication.Theytakecareofdataquerying,validation,processingandmore.Thedesignroleisforthedevelopersthatareresponsiblefortheapplicationlookandfeel.Theydisplaydatathatisfedfromthedevelopersworkingonthefirstrole.Theintegrationrolegathersdeveloperswiththeresponsibilitytogluetheworkoftheprevioustworoles.[3]TheMVCdesignpatternissuchagoodfitforwebapplicationdevelopmentbecausetheycombineseveraltechnologiesusuallysplitintoasetoflayers.Also,MVCspecificbehaviorcouldbetosendspecificviewstodifferenttypesofuser-agents.[13]“UserinteractionwithanMVCapplicationfollowsanaturalcycle:theusertakesanaction,andinresponsetheapplicationchangesitsdatamodelanddeliversanupdatedviewtotheuser.Andthenthecyclerepeats.ThisisaveryconvenientfitforwebapplicationsdeliveredasaseriesofHTTPrequestsandresponses.”[4]3.1.TheModelTheModelisthepartofthesystemthatmanagesalltasksrelatedtodata:validation,sessionstateandcontrol,datasourcestructure(database).TheModelgreatlyreducesthecomplexityofthecodethedeveloperneedstowrite.TheModellayerisresponsiblewiththebusinesslogicofanapplication.Itwillencapsulatemethodstoaccessdata(databases,files,etc.)andwillmakeareusableclasslibraryavailable.UsuallyaModelisbuiltwithdataabstractioninmind,validationandauthentication.[4]Moreover,theModelismadeupofclassesthatdefinethedomainofinterest.Theseobjectsthatbelongtothedomainoftentimesencapsulatedatathatisstoredindatabases,butalsoincludecodethatisusedtomanipulatethisdataandenforcebusinessrules.[6]Asaconclusion,theModelmainlyhandlesdataaccessabstractionandvalidation.TheModelholdsmethodsforinteractionwithdifferentdatasources.WebelieveintheThinModelapproach,whichsaysthatamodelshouldbekeptassimpleaspossible,onlyencompassingdataprocessingthatisstrictlytiedtothereallifeobjectthatismodeled.TheThinModeliscoupledwithaFatController,whichhousesmostofthedataprocessingrequiredbytheapplication.Thisway,themodelsbecomehighlyreusablebetweenapplicationsandmostofadeveloper’sworkiskeptinsidecontrollers.ThenoveltyourModelsystembringstotheMVCworldisasystemforversioningcontrol,basedontheideaofmigrations,thatdoesn’tonlykeeptrackofdatastructurebutofdataitself.Thesystemusesxmlfilestostoredatabetweenmigrations,makingtheversioningprocessfordatabasesaneasilyaccomplishablething.3.2.TheViewTheViewisresponsiblewithgraphicaluserinterfacemanagement.Thismeansallforms,buttons,graphicelementsandallotherHTMLelementsthatareinsidetheapplication.ViewscanalsobeusedtogenerateRSScontentforaggregatorsorFlashpresentations.Byseparatingthedesignoftheapplicationfromthelogicoftheapplicationwegreatlyreducetheriskoferrorsshowingupwhenthedesignerdecidestoaltertheinterfaceofthatapplicationbychangingalogooratable.Inthesametime,thedevelopers’jobisgreatlyreducedbecausehenolongerneedstoseeHTMLcodeelements,designelementsandgraphicalelements.[5]TheViewlayeriswhatcannormallybecalledwebdesignortemplates.Itcontrolsthewaydataisdisplayedandhowtheuserinteractswithit.Italsoprovideswaysfordatagatheringfromtheusers.ThetechnologiesthataremainlyusedinviewsareHTML,CSSandJavaScript.[4]Asageneralrule,aviewshouldnevercontainelementsthatbelongtoapplicationlogic,inordertomakeiteasierforthedesignertoworkwithit.Thismeanslogicalblocksshouldbekeptataminimum.MostwebapplicationframeworkstodayusesomesortoftemplateenginethattakesadvantageofgeneratorelementsinordertokeepHTMLcodeataminimumandreducetheriskoftypingmistakes.Thesegeneratorsareusuallyusedtomakecomplexwebpartials,likeforms,tables,lists,menusandsoon.Theproblemweidentifiedinthiscaseisthatallimplementationsofthisideausebehindthescenesoropaquegenerationofpartials.Thisway,afront-enddevelopercanonlyseetheresultingcodeafterit’sbeengenerated,havinglittletonowayofmodifyingthetemplate.OursystemusesspecialHTMLcommentstoinsertandgeneratepartialsbasedontemplatesthatarealsoHTML-onlyfiles.Thepre-processingsystemusesthecommentstointerpretspecialcommandsinordertoinsertdataintothetemplates.Thismakesthewholeprocessverytransparentforthefront-enddeveloper,whocanseethewholemarkupbeforerenderingtheview.3.3.TheControllerTheControllerisresponsibleforeventhandling.Theseeventscanbetriggeredbyeitherauserinteractingwiththeapplicationorbyasystemprocess.Acontrolleracceptsrequestsandpreparesthedataforaresponse.Itisalsoresponsiblewithestablishingtheformatofthatresponse.TheControllerinteractswiththeModelinordertoretrievetheneededdataandgeneratestheView.Thisprocessisalsoknownasanactionoraverb.[5]Whenarequestarrivesattheserver,theMVCframeworkdispatchesittoamethodinacontrollerbasedontheURL.[14]TheControllerbindsallapplicationlogicandcombinesthedisplayintheViewwiththefunctionalityintheModel.ItisresponsiblewithdataretrievalfromtheViewandwithestablishingtheexecutionpathfortheapplication.TheControllerwillaccesstheModelfunctionalityanditwillinterpretthedatareceivedsothatitcanbedisplayedbytheView.Itisalsoresponsiblewitherrorhandling.[4]AControllermanagestherelationshipbetweenaViewandaModel.Itrespondstouserrequests,interactswiththeModelanddecideswhichViewshouldbegeneratedanddisplayed.[6]Asmentionedabove,weembracetheFatControllerapproach,believingthatallapplication-specificdataprocessingshouldbehandledatthecontrollerlevel.OurcontrollersystemisRESTfulandsupportsJSON(P),textandXMLdataformatsforrequestsandresponses.4.DatabaseabstractionInobjectorientedprogrammingapplicationsarebuiltusingobjects.Theseobjectsreflectreallifeobjectsandtheycontainbothdataandbehavior.Therelationalmodelthatiswidelyusedfordatastorageinapplicationsusestablestostoredataanddatamanipulationlanguagestointeractwiththatdata.Somedatabasemanagementsystemshaveobjectorientedfeatures,buttheyarenotfullycompatible.Itisveryclearthatthesetwoarchitecturesarewidelyusedandwillbeforalongtimefromnow.Moreover,therelationalmodelandobjectorientedprogrammingareusedtogethermostofthetimetobuildapplicationsofeveryscale.Butthewaythetwotechnologiescombineisfarfromperfect.Thetermusedforthismismatchis“object-relationalimpedancemismatch”.[7]Thereasonbehindthismismatchisthatthetwotechnologiesrelyondifferentconcepts.Objectorientedprogrammingreliesonprovedprogrammingconcepts,whiletherelationalmodelsfollowsmathematicalprinciples.Object-relationalmappingsystemsweredevelopedsolelytoaddressthisissue.Anobject-relationalmappingsystem(ORM)isdefinedasbeingatoolthatprovidesamethodologyandamechanismforobjectorientedsystemstostoredatainsafewayandforalongperiodoftimeinadatabase,havingtransactionalcontroloverthem,butbeingexpressed,ifneeded,asobjectsinsidetheapplication.[8]AnORMsystemfreesthedeveloperfromtheworryofknowingthedatabasestructureorschema.Dataaccessisdoneusingaconceptualmodelthatreflectsthedevelopers’businessobjects.[9]Inconclusion,wecansaythatanobject-relationalmappingsystemisawaytocorrelatedatafromarelationalsystemwithclassesinaprogramminglanguage,allowingthedevelopertoworkwithwell-knownconceptsfromobjectorientedprogrammingtomanagedatafromthatrelationalsystem.AnMVCplatformmustprovidedeveloperswithawaytointeractwithadatabasemanagementsystemtostoreandretrievedata.Mostofthetimes,thisisanintegratedORMsystem.BecauseintheMVCarchitecturetheModelisthelayerthatinteractswithdata,theORMsystemishiddenbehindit.Basically,eachModelisconnectedtotheORMsystemsanditusesthesystemtointeractwithdata.ButdevelopersmayaccesstheresourcesoftheORMsystemwithouttheneedtouseaModel.OurORMsystemsupportsmany-to-manyrelationsbetweenobjectsandhasasettingformaximumdepthlevelforobjectlinkage.Also,weprovideanoptiontokeepcertaindatasetsinmemoryandskipdatabasequerying,reducingresponsetimesataminimum.AsfarasNoSQLdatastoresareconcerned,wesupportaninterfacetoaccessanumberofsuchsystems.ThisinterfaceispartoftheORMsystem.5.SecurityWebapplicationvulnerabilitiesarethemaincauseofattackonusersfromthebusinessenvironment.[10]Therearealotofthingsdevelopersneedtobeawarewhenbuildingwebapplications.Securityriskscanbedividedintoseveralcategories:[11]Userinputvalidation:bufferoverflow,cross-sitescripting,SQLinjection,canonicalization;Authentication:networksniffing,brute-forceattacks,dictionaryattacks,cookiefaking,identitytheft;Authorization:accessprivilegeviolation,privatedatadisplay,dataaltering,stalkingattacks;Configurationmanagement:unauthorizedaccesstothemanagementinterface,unauthorizedaccesstoconfigurationzones,accesstoconfigurationdatastoredastext,lackofactionlogging;Sensibleinformation:accesstosensibledatainthedatabase,networksniffing,dataaltering;Sessionmanagement:sessiontheft,sessionaltering,maninthemiddleattacks;Encryption:weaksecuritykeys,weakencryption;Parametermanipulation:querystring,formfield,cookieandHTTPheadermanipulation;Exceptionmanagement:DOSattacks;DevelopersneedtodefendagainstallofthesetypesofattacksandsecurityneedstobehandledateverylayerintheMVCarchitecture.OursystemproposalhasbuiltinCSRFattackprevention,asimpleauthenticationschema,acomplexrolebasedsecuritysystemandhighlycustomizableaccesscontrollistsforresources.6.RoutingThewaytheHTTPprotocolhandlesURLwritingisverysimilartothewayresourcepathsarewrittenintheUnixenvironment.[12]Webserversbearthisinmindandimplicitlylookfordatainahierarchicalfilesystem.Thiswayofaccessingresourcesisrelativelyeasyandintuitive,butaswebapplicationcomplexitygrows,theneedforabettersystemarises.Tosolvethis,wecanconfigurethewebserverandthedevelopmentframeworkinsuchawaythatitwillinterpretresultsinauniquemannerandaccesstheresources.ThesesystemsarecalledURLMappingorURLRoutingsystems.ThetechniqueisalsoknownasURLBeautifyingandhelpsdevelopersbuildorderedandniceURLsdatabothusersandsearchenginescanhandlebetter.Oursystemisbuiltonthe“controller/action/params”paradigm,butitalsoallowsdeveloperstoconfiguretheirownstaticroutes.Accesscontrolisdoneattheroutinglevelinordertoreduceunneededprocessingtime.7.RapidprototypingIntheworldofwebapplicationdevelopmentalotofapplicationpartsseemtobeusedmultipletimes.Forexamplewebformsareatoolthatisusedreallyoften.Soaretablesandlists.Butbuildingsuchelementsfromscratchisratherdifficultmanytimes,becausetheinvolvewritingalotofcomplexmarkup.Eachsystemcanbenefitfromarapidprototypingmodulethatnotonlygeneratesthesetoolsquickly,butalsoprovideswaystovalidatedata(forforms).SuchtoolsarereallyusefulwhencombinedwithORMsystemstobuildCRUDsystemsfromthegroundupwithveryfewlinesofcode.AsstatedinthesectiononViewsabove,oursystemisbasedonaflexibleandfullytransparenttemplateengine,thatcomestobenefitbothback-endandfront-enddevelopersalike.8.SystemproposaloverviewOurplatformproposalunifiesalloftheaboveaspectsinonesinglepackagethatisrobustandeasytouseandmaintain.Thestructureabovecanbedescribedasfollows.Thedatasourcecanbeanytypeofdatabase.TheORMsystemisasetofclassesbuiltspecificallyformostwell-knowndatabasemanagementsystems.Onemainclassprovidesbasicmapping,relationsandmanagementforageneraltypeoftableinthedesiredDBMS.Relationsshouldbemappedastoallowfetchingofrelateddatainanobjectorientedway,withouttheneedforcomplexquerieswrittenbythedeveloper.Botheagerandlazyloadingofdatashouldbeconsidered.ModelsarebuiltaschildrenofthemainORMclassinheritingfunctionalityfromthatmainclass.Inaddition,Modelsareenrichedwithuniquecapabilitiesthatdescribethereallifeobjectthatshouldbemodeled.TheControllerisabaseclassthathandlesModelquerying,accesssecurityandrouteresolving.ControllersarebuiltaschildrenofthebaseControllerandinheritthefunctionalityandareenrichedwithapplicationlogiccorrespondingwiththedesiredactions.TheRapidPrototypingsystemisassetofclassesthatallowdeveloperstobuildcomplexHTMLobjectslikeformsandtableswithouttheneedtowriteHTMLcode.Formsshouldprovidethepossibilityofdatavalidationandtablesthatofsortingandnesting.TheRapidPrototypingsystemshouldprovideDOM-likemanipulationcapabilitiesinordertoaccessthedata. 3.MVCstructureproposal.TheViewisabaseclasscontainingalldisplaylogic.Viewsarebuiltaschildrenofthismainclassandshouldbetiedtoaspecificactionandcontroller.Viewsshouldbepre-renderedforperformancereasonsandshouldbecapableofcaching.TheViewsystemcandependofaTemplatesystemandaPartialssystemforcodereuse.9.ConclusionBasedontheproposalformulatedabove,wehavebuiltasolidframeworkthatiscapableofreducingwebapplicationdevelopmenttimesdrastically,allowingdeveloperstofocusonapplicationspecifictasks,ratherthanwastingtimetryingtoimplementwell-knownpatternsandpractices.Webtechnologieshavecomealongwayinlittletimeandthemarketforwebapplicationsisevergrowing.Oursystemhelpsdevelopersimprovetheirworkspeedandqualityandprovidesaniceworkingframeworkandplatformforbothbeginnersandexperiencedusers.Wehavebuiltanumberofapplicationsusingcomponentsformtheplatformpropositionandtheseapplicationsshowthatthesystemwearebuildingisontherighttrack,whilegivingusvaluableinputonthingsthatneedtobeimproved.10.FurtherresearchThefocusofourfutureresearchinthisareaisimprovingsupportforthevariousNoSQLsystemsthatareavailable,becausewethinkthisareaisofbigfutureinterestfortheITcommunity.Also,weaimatimprovingthespeedoftherenderingenginebyincorporatingcachingtechniquesfordataandviews.Anotherimportantstepislaunchingtheprojectintheopensourcecommunityinordertobuildmoretestcaseapplicationsthatgeneratevalidresults.Theseresultswillbeusedtofurtheroptimizetheplatform.Also,weaimtosupportpackagesbuiltbythecommunityinordertofurtherextendtheplatform.
附錄B外文翻譯—譯文部分1.介紹自萬維網(wǎng)開始以來,Web應(yīng)用程序開發(fā)已經(jīng)走過了漫長的道路。無數(shù)的現(xiàn)在使用技術(shù)和編程語言來構(gòu)建Web應(yīng)用程序,但由于世界的方式。萬維網(wǎng)發(fā)展了,因為它的速度,所以這些技術(shù)沒有真正的時間來發(fā)展,并跟上步伐。許多球員試圖提出不同的和異國情調(diào)的技術(shù),主要是改善。用戶體驗和幫助開發(fā)人員構(gòu)建更快更強大的Web應(yīng)用程序。這些技術(shù)中的一些在Web開發(fā)中起到了重要作用,但在過去幾年中,使用率有了很大的下降,比如java小應(yīng)用程序和MicrosoftSilverlight。另一方面,許多技術(shù)已經(jīng)從簡單的玩具發(fā)展到強大的和重要的部分今天的網(wǎng)絡(luò)生態(tài)系統(tǒng),如JavaScript,F(xiàn)lash和XML。今天的Web環(huán)境使用HTML和CSS向用戶呈現(xiàn)數(shù)據(jù),交互通過JavaScript。這些技術(shù)被稱為“前端”或“客戶端”技術(shù)。另一方面,“后端”或“服務(wù)器端”技術(shù)是指數(shù)據(jù)存儲和處理技術(shù)。2.問題公式化前端和后端技術(shù)結(jié)合在一起構(gòu)建Web應(yīng)用程序,但因為萬維網(wǎng)以如此快的速度發(fā)展,因為開發(fā)者需要使用相當(dāng)數(shù)量的技術(shù)來構(gòu)建。僅僅是一個Web應(yīng)用程序,它們的工作結(jié)果往往難以維護和修復(fù)。開發(fā)人員將HTML代碼與服務(wù)器端編程語言相結(jié)合,創(chuàng)建動態(tài)網(wǎng)頁。應(yīng)用程序,這導(dǎo)致高度糾纏和不可維護的代碼。另一個問題是Web技術(shù)越來越多地被用來建立各種各樣的問題。復(fù)雜的應(yīng)用程序。微軟擁抱Web技術(shù),鼓勵開發(fā)者為其構(gòu)建應(yīng)用程序。最新操作系統(tǒng),Windows8。還有很多框架幫助Web開發(fā)人員編寫應(yīng)用程序,移動設(shè)備,如PoiGeAP和AppCuxor鈦。甚至,移動操作系統(tǒng)也在運行中。預(yù)計今年晚些時候?qū)⑼耆褂肳eb技術(shù)來開發(fā)開發(fā)者API(MozillaFirefoxOS)。由于這些原因,Web應(yīng)用程序通常由一組專門的開發(fā)人員創(chuàng)建,每一個都在工作。以他們最喜歡的技術(shù),比如HTML和CSS為表示層,JavaScript用于客戶端交互,PHP(或ASP、java、python、Pearl、露比等)的服務(wù)器端邏輯和MySQL(或Oracle數(shù)據(jù)庫、微軟SQL用于數(shù)據(jù)存儲和管理的服務(wù)器等。每一位專家都需要與他們的同事合作,這樣他們的代碼塊就在里面??傮w設(shè)計應(yīng)用。例如,客戶端(數(shù)據(jù)呈現(xiàn))開發(fā)人員需要更改HTML。以及CSS代碼,這樣他就不會破壞駐留在同一文件中的服務(wù)器端開發(fā)人員的代碼。也當(dāng)數(shù)據(jù)庫開發(fā)人員更改應(yīng)用程序的架構(gòu)時,服務(wù)器端開發(fā)人員可能需要改變很多,使應(yīng)用程序工作的代碼。這里要注意的是,迫切需要將演示文稿從邏輯和數(shù)據(jù)存儲中分離出來。在應(yīng)用程序中,有一些應(yīng)用程序設(shè)計模式和模式提供了解決這個問題的方法,但重點是現(xiàn)在是MVC模式。在進行研究時,我們使用我們的經(jīng)驗是用各種系統(tǒng)構(gòu)建Web應(yīng)用程序??蚣芎臀覀円呀?jīng)嘗試識別這些系統(tǒng)的優(yōu)點和缺點,同時提供我們自己的。如何改善這些做法的看法。研究框架和系統(tǒng)包括:SyfFONE,CaKEPHP,CODEGITERZED框架,LARAVER,燃料PHP,RubyonRails和ASP.NETMVC。3.MVC模式與文獻綜述在這一節(jié)中,我們將回顧這一領(lǐng)域的研究現(xiàn)狀,并看后面的文獻。MVC模式,描述模式的主要功能部分。MVC設(shè)計模式最初是由TrygveReenskaug在20世紀70年代在施樂PARC設(shè)想的。根據(jù)他說:“MVC的本質(zhì)目的是彌合人類用戶心智模型和數(shù)字之間的鴻溝。他們強調(diào),如果一個人在模塊化的基礎(chǔ)上構(gòu)建應(yīng)用程序,就會得到巨大的好處?!氨M可能多地隔離功能單元使應(yīng)用程序設(shè)計者更容易理解和修改每個特定的單元,而不必知道其他單元的所有內(nèi)容?!睉?yīng)用程序分為三大類:主應(yīng)用程序域的模型、演示文稿。該模型中的數(shù)據(jù)和用戶交互。MVC模式將責(zé)任分成三個主要角色,從而允許更有效的協(xié)作。這些主要角色是開發(fā)、設(shè)計和集成。開發(fā)的角色是由負責(zé)邏輯的有經(jīng)驗的程序員承擔(dān)的,應(yīng)用。他們負責(zé)數(shù)據(jù)查詢、驗證、處理等等。設(shè)計角色是為開發(fā)人員負責(zé)應(yīng)用程序的外觀和感覺。他們顯示數(shù)據(jù)是從開發(fā)人員的第一個角色。集成角色聚集開發(fā)人員的責(zé)任來粘合前兩個角色的工作。MVC設(shè)計模式非常適合Web應(yīng)用程序開發(fā),因為它們結(jié)合了幾個技術(shù)通常分為一組層。此外,MVC特定的行為可以發(fā)送特定的視圖到不同類型的用戶代理?!芭cMVC應(yīng)用程序的用戶交互遵循自然周期:用戶采取行動,并響應(yīng)應(yīng)用程序更改其數(shù)據(jù)模型,并將更新的視圖傳遞給用戶。然后循環(huán)重復(fù)。這是一個非常適合作為一系列HTTP請求和響應(yīng)傳遞的Web應(yīng)用程序。3.1模型該模型是管理與數(shù)據(jù)相關(guān)的所有任務(wù)的系統(tǒng)的一部分:驗證、會話狀態(tài)和控制,數(shù)據(jù)源結(jié)構(gòu)(數(shù)據(jù)庫)。該模型極大地降低了開發(fā)人員需要編寫的代碼的復(fù)雜性。模型層負責(zé)應(yīng)用程序的業(yè)務(wù)邏輯。它將封裝訪問的方法。數(shù)據(jù)(數(shù)據(jù)庫,文件等),并將使一個可重用的類庫可用。通常模型是用數(shù)據(jù)建立的。頭腦中的抽象、驗證和驗證。此外,該模型由定義感興趣域的類組成。這些對象屬于域經(jīng)常封裝存儲在數(shù)據(jù)庫中的數(shù)據(jù),但也包含用于操作此代碼的代碼。數(shù)據(jù)和執(zhí)行業(yè)務(wù)規(guī)則。作為一個結(jié)論,該模型主要處理數(shù)據(jù)訪問抽象和驗證。該模型適用于與不同數(shù)據(jù)源的交互。我們相信薄模型方法,它認為模型應(yīng)該盡可能地保持簡單。包含與建模的實際生命對象嚴格相關(guān)的數(shù)據(jù)處理。薄模型耦合有一個FAT控制器,它容納了應(yīng)用程序所需的大部分數(shù)據(jù)處理。這樣,模型在應(yīng)用程序之間變得高度可重用,并且大多數(shù)開發(fā)人員的工作被保存在控制器內(nèi)部。我們的模型系統(tǒng)帶給MVC世界的新奇是一種基于版本控制的版本控制系統(tǒng)。遷移,它不僅跟蹤數(shù)據(jù)結(jié)構(gòu),而且跟蹤數(shù)據(jù)本身。系統(tǒng)使用XML文件來存儲數(shù)據(jù)。在遷移之間,使數(shù)據(jù)庫的版本化過程容易完成。3.2視圖該視圖負責(zé)圖形用戶界面管理。這意味著所有的形式,按鈕,圖形元素和應(yīng)用程序內(nèi)部的所有其他HTML元素。視圖還可以用來生成RSS。聚合器或Flash演示文稿的內(nèi)容。將應(yīng)用程序的設(shè)計與邏輯的分離應(yīng)用程序,當(dāng)設(shè)計者決定更改界面時,大大減少了出現(xiàn)錯誤的風(fēng)險。通過更改徽標(biāo)或表格來進行應(yīng)用。與此同時,開發(fā)商的工作也大為減少,因為他沒有。更長的時間需要查看HTML代碼元素、設(shè)計元素和圖形元素.視圖層通常被稱為Web設(shè)計或模板。它控制顯示數(shù)據(jù)的方式。用戶如何與之交互。它還提供了從用戶收集數(shù)據(jù)的方式。技術(shù)是主要用于視圖,有HTML、CSS和JavaScript。作為一般規(guī)則,視圖不應(yīng)該包含屬于應(yīng)用邏輯的元素,以便使其更容易。讓設(shè)計師使用它。這意味著邏輯塊應(yīng)該保持在最小值。目前大多數(shù)Web應(yīng)用框架使用某種利用生成器的模板引擎。元素,以便將HTML代碼保持在最低限度,減少鍵入錯誤的風(fēng)險。這些發(fā)電機是通常用于制作復(fù)雜的Web部分,如窗體、表格、列表、菜單等。我們發(fā)現(xiàn)的問題這種情況是,這個想法的所有實現(xiàn)都使用幕后或不透明的部分生成。這樣,前端開發(fā)人員只能看到生成后的代碼,幾乎沒有修改方法。模板。我們的系統(tǒng)使用特殊的HTML注釋來插入和生成基于僅HTML文件。預(yù)處理系統(tǒng)使用注釋來解釋特殊命令以便插入模板中的數(shù)據(jù)。這使得整個開發(fā)過程對于前端開發(fā)人員來說非常透明,他們可以看到在呈現(xiàn)視圖之前的整個標(biāo)記。3.3控制器控制器負責(zé)事件處理。這些事件可以由用戶交互來觸發(fā)。應(yīng)用或通過系統(tǒng)過程??刂破鹘邮苷埱蟛轫憫?yīng)準備數(shù)據(jù)。它也是負責(zé)建立響應(yīng)的格式??刂破髋c模型交互以檢索。需要的數(shù)據(jù)并生成視圖。這個過程也稱為動作或動詞。當(dāng)請求時到達服務(wù)器時,MVC框架將其調(diào)度到基于URL的控制器中的方法中。控制器綁定所有應(yīng)用程序邏輯,并將視圖中的顯示與功能中的功能進行組合。模型。它
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025至2030年中國低壓隔膜泵數(shù)據(jù)監(jiān)測研究報告
- 2025年中國高純超細硅酸鋯市場調(diào)查研究報告
- 2025年中國防腐型單座調(diào)節(jié)閥市場調(diào)查研究報告
- 2025年中國金屬底色漆市場調(diào)查研究報告
- 2025年中國輥底式退火爐市場調(diào)查研究報告
- 2025年中國立式液下排污泵市場調(diào)查研究報告
- 2025年中國石墨真空固化爐市場調(diào)查研究報告
- 二零二五年度高端保健養(yǎng)生館整體轉(zhuǎn)讓及裝修改造合同
- 輕奢風(fēng)格裝修協(xié)議
- 2025年度企業(yè)財產(chǎn)保險服務(wù)采購居間合同范本
- 質(zhì)量部架構(gòu)圖
- 結(jié)構(gòu)化學(xué)-第1章講義課件
- 粉塵防爆安全管理臺賬-全套
- 廣州退休申請表范本
- 管道完整性管理方法及應(yīng)用
- 傳媒侵權(quán)法介紹
- 麥茬花生高產(chǎn)栽培技術(shù)
- 玉米制種技術(shù)
- 中國旅游資源概述
- 高一下分科文科班第一次主題班會
- 初中數(shù)學(xué)代數(shù)式部分的文本解讀
評論
0/150
提交評論