餐饮管理系统外文翻译范文.docx
- 文档编号:6841252
- 上传时间:2023-01-11
- 格式:DOCX
- 页数:17
- 大小:126.71KB
餐饮管理系统外文翻译范文.docx
《餐饮管理系统外文翻译范文.docx》由会员分享,可在线阅读,更多相关《餐饮管理系统外文翻译范文.docx(17页珍藏版)》请在冰豆网上搜索。
餐饮管理系统外文翻译范文
外文文献资料
AComparativeStudyofWebApplicationDesignModels
UsingtheJavaTechnologies
Abstract.
TheServlettechnologyhasbeenthemostwidelyusedtechnologyforbuildingscalableWebapplications.Intheevents,therearefourdesignmodelsfordevelopingWebapplicationsusingtheJavatechnologies:
Model1,Model2,Struts,andJavaServerFaces(JSF).Model1employsaseriesofJSPpages;Model2adoptstheModel-View-Controllerpattern;StrutsisaframeworkemployingtheModel2designmodel;andJSFisanewtechnologythatsupportsready-to-usecomponentsforrapidWebapplicationdevelopment.Model1isnotrecommendedformedium-sizedandlargeapplicationsasitintroducesmaintenancenightmare.Thispapercomparesandevaluatestheeaseofapplicationdevelopmentandtheperformanceofthethreedesignmodels(Model2,Struts,andJSF)bybuildingthreeversionsofanonlinestoreapplicationusingeachofthethreedesignmodels,respectively.
1Introduction
Today,Webapplicationsarethemostcommonapplicationsforpresentingdynamiccontents.ThereareanumberoftechnologiesforbuildingWebapplications,themostpopularofwhichistheServlettechnology.ThistechnologygainsitspopularityfromitssuperiorityoverothertechnologiessuchasCGIandPHP.Servletsarecumbersometodevelop,however,becausesendingHTMLtagsrequirestheprogrammertocomposethemintoaStringobjectandsendthisobjecttothebrowser.Also,aminorchangetotheoutputrequirestheservlettoberecompiled.Toaddressthisissue,SunMicrosystemsinventedJavaServerPages(JSP).JSPallowsHTMLtagstobeintertwinedwithJavacodeandeachpageistranslatedintoaservlet.AJSPpageisaservlet.However,compilationoccursautomaticallywhenthepageisfirstrequested.Asaresult,changingtheoutputdoesnotneedrecompilation.Inaddition,JSPenablestheseparationofpresentationfromthebusinesslogicthroughtheuseofJavaBeansandcustomtaglibraries.ThenormnowindevelopingJavabasedWebapplicationsistouseservletsalongwithJavaServerPages.
Inthelaterdevelopment,thereareanumberofdesignmodelsforbuildingservlet/JSPapplications:
Model1,Model2,Struts,andJSF.Model1andModel2werefirstmentionedintheearlyspecificationsofJSP.Model1strictlyusesJSPpages,withnoservlets,andModel2usesthecombinationofbothservletsandJSPpages.ThetermsofModel1andModel2havebeenusedeversince.Model1issuitableforprototypesandverysmallapplications,andModel2istherecommendeddesignmodelformediumsizedandlargeapplications.
AsModel2gainedmoreacceptancesintheindustry,anopensourceinitiativetobuildtheStrutsFrameworkwasinitiated.StrutsperfectsModel2byprovidingthecontrollerpartoftheModel-View-ControllerofModel2.Inaddition,Strutsprovidesbetterpagenavigationmanagementandseveralcustomtaglibrariesformorerapiddevelopment.Despiteitssteeplearningcurveandthefactthatitwasneverdefinedinanyspecification,StrutshasbeengainingpopularityasthealternativetoModel2.
JavaServerFacesisbuiltundertheJavaCommunityProcessunderJSR-127.SunMicrosystemsproposedthistechnologyinthehopethatJSFwillbetheultimatemodelforbuildingJavaWebapplications.ThemostimportantfeatureofJSFistheavailabilityofready-to-usecomponentssuchasextensibleUIcomponents,easypagenavigation,inputvalidators,dataconvertersandJavaBeansmanagement.
Theproblemfacingservlet/JSPprogrammersaretochoosethemostappropriatedesignmodel.Clearly,JSFprovidesabettersolutioninregardtodevelopmenttime.However,somepeoplearenotsanguinetoadoptthistechnologyforfearofperformancepenaltyduetotheoverheadoftheJSFimplementation.
WebuildthreeversionsofanonlinestoreapplicationnamedBuyDirectusingModel2,StrutsandJSF.Theparameterscomparedarethenumberoflinesofcode,thenumberofclasses,andtheperformancemeasurementresults.Weinvestigatewhichofthedesignmodelsallowsthemostrapiddevelopmentprocess.Weevaluatetheperformancesoftheapplicationsbuiltuponthesemodels.Weprovidesomesuggestionstoperfecttheexistingdesignmodelstomakedevelopmentmorerapid.
Therestofthepaperisorganisedasfollows.Section2discussestheissuesinWebdevelopment.Section3explainshowthethreedesignmodelsaddressthesedevelopmentissues.Section4providesthedetailsofthehardwareandsoftwareusedintheseexperiments.Section5presentstheexperimentresultsandanalysis.Section6reviewstherelatedwork.Section7concludesbyofferingsomesuggestionstoimprovetheexistingdesignmodels.
2JavaWebDevelopmentIssues
AllJavaWebdevelopmentusestheServlettechnologyastheunderlyingtechnology.Assuch,allJavaWebapplicationshavecertainissuesthatneedtobeaddressed:
●UserInterface.TheuserinterfaceiswhattheclientbrowserrendersasHTMLtags.Anyserver-sidecomponentusedintheapplicationmustbeencodedintothecorrespondingHTMLelements.Besidesfordisplayingthecontentanddata,theuserinterfaceisalsoresponsibleinreceivinginputfromtheuser.
●InputValidation.Userinputneedstobevalidated.Therearetwotypesofinputvalidation,server-sideandclient-side.Asthenameimplies,theserver-sideinputvalidationisperformedontheserveraftertheinputreachestheserver.Client-sideinputvalidationisdoneonthebrowser,usuallybyusingJavaScriptorotherscriptinglanguages.Theadvantagesofusingclient-sideinputvalidationarepromptresponseandreducingtheserverworkload.Theserver-sideinputvalidationshouldalwaysbeperformedregardlessthepresenceofclient-sidevalidationbecausethereisnoguaranteetheuserbrowser'sscriptingfeatureisbeingonandmalicioususerscaneasilyworkaroundclient-sidevalidation.
●ModelObjects.ModelobjectsinJava-basedWebapplicationsareintheformsofJavaBeans.ModelobjectsmakeuptheModelpartoftheMVCbaseddesignmodel.Amodelobjectcanbeusedtobindacomponentvaluetobeusedatalaterstage.Inaddition,itcanencapsulatebusinesslogicrequiredforprocessing.
●PageNavigation.AlmostallWebapplicationshavemultiplepagesthattheusercannavigatefromonetoanother.AllMVC-baseddesignmodelsuseaservletastheControllerpart.Thisservletalsoactsasthesoleentrypointtotheapplication.Whichpagetobedisplayedafterthecurrentrequestisdeterminedbythevalueofaspecifiedrequestparameter.Managingpagenavigationiscriticallyimportant.
3WebApplicationDesignModels
TheModel2designmodelisbasedontheModel-View-Controller(MVC)designpattern.AsexplainedbyBurbeck,therearethreemainmodulesinMVC,theController,theView,andtheModel.TheControlleractsasthecentralentrypointtotheapplication.Alluserinteractionsgothroughthiscontroller.TheViewcontainsthepresentationpartoftheapplication,andtheModelstoresdataorencapsulatesbusinesslogicoftheapplication.Inthelaterdevelopment,theStrutsFrameworkprovidesacommonframeworktoeasilybuildModel2applications.Then,thelastinitiativeistheJavaServerFaces,whichalsoemploystheMVCdesignpattern.
Inthefollowingsections,wediscussthesethreedesignmodelsandexplainhoweachdesignmodeladdressesthedevelopmentissuesspecifiedintheprevioussection.
3.1Model2
AJavaWebapplicationthatisbasedontheModel2designmodelhasoneservlet(calledtheControllerservlet)thatservesastheControllerpart.Allrequestsarefirsthandledbythisservlet,whichimmediatelydispatchestherequeststotheappropriateviewsusingRequestDispatcherobjects.ViewsintheModel2designmodelarerepresentedbyJSPpages.Tostoredata,aModel2applicationusesJavaBeans,whicharetheModelpartoftheapplication.Inadditiontostoringdata,theJavaBeansalsoencapsulatebusinesslogic.EachHTTPrequestcarriesanactionparameterthatindicateswhichviewtodispatchthisrequestto.TheprogrammermustcodetheHTMLtagsforuserinterfaceinallJSPpagesintheapplicationandwriteinputvalidationcode.Inaddition,themodelobjectsaremanagedbyindividualJSPpages.
3.2Struts
TheStrutsFrameworkisanimprovementoftheModel2designmodel.ItprovidesadefaultControllerservletsothattheuserdoesnothavetowriteandcompileone.Strutsalleviatesthetaskofpagenavigationbyallowingnavigationrulestobepresentinitsapplicationconfigurationfile(anXMLdocument).ChangestothenavigationrulesdonotrequirerecompilationofaJavaservletclass.Inadditiontoeasierpagenavigation,StrutsprovidescustomtaglibrariesthatdefinetagsrepresentingHTMLelements.OneofthesetagsisusedforerrorhandlingandStrutsisthereforecapableofdisplayinglocalizederrormessagesinsupportforinternationalization.StrutsapplicationsuseJavaBeansastheirmodels,justliketheModel2designmodel.Inaddition,Strutsprogrammershavetowritetheirowninputvalidationcode.
3.3JSF
JSFalsoemploysacontrollerservletthatiscalledFacesServlet.ThisservletistheonlyentrypointtoaJSFapplication.JSFalsousesJSPpagesasitsviewsandJavaBeansasitsmodelobjects.UnlikeModel2andStruts,however,JSFprovidesready-to-useuserinterfacecomponentsthatcanbewrittenonJSPpages.UponaninvocationofapageofaJSFapplication,theFacesServletconstructsacomponenttreethatrepresentstheJSPpagebeingrequested.Someofthecomponentscanalsotriggerevents,makingJSFevent-driven.Forpagenavigation,JSFusesanapproachsimilartoStruts,i.e.,byallowingnavigationrulestobedefinedinanapplicationconfiguration
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 餐饮 管理 系统 外文 翻译 范文
![提示](https://static.bdocx.com/images/bang_tan.gif)