A-Comparative-Study-of-Web-Application-Design-Mode

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

J.X.Yu,X.Lin,H.Lu,andY.Zhang(Eds.):APWeb2004,LNCS3007,pp.711–721,2004.©Springer-VerlagBerlinHeidelberg2004AComparativeStudyofWebApplicationDesignModelsUsingtheJavaTechnologiesBudiKurniawanandJinglingXueSchoolofComputerScienceandEngineeringUniversityofNewSouthWalesSydney,NSW2052,AustraliaAbstract.TheServlettechnologyhasbeenthemostwidelyusedtechnologyforbuildingscalableWebapplications.Intheevents,therearefourdesignmodelsfordevelopingWebapplicationsusingtheJavatechnologies:Model1,Model2,Struts,andJavaServerFaces(JSF).Model1employsaseriesofJSPpages;Model2adoptstheModel-View-Controllerpattern;StrutsisaframeworkemployingtheModel2designmodel;andJSFisanewtechnologythatsupportsready-to-usecomponentsforrapidWebapplicationdevelopment.Model1isnotrecommendedformedium-sizedandlargeapplicationsasitintroducesmaintenancenightmare.Thispapercomparesandevaluatestheeaseofapplicationdevelopmentandtheperformanceofthethreedesignmodels(Model2,Struts,andJSF)bybuildingthreeversionsofanonlinestoreapplicationusingeachofthethreedesignmodels,respectively.1IntroductionToday,Webapplicationsarethemostcommonapplicationsforpresentingdynamiccontents.ThereareanumberoftechnologiesforbuildingWebapplications,themostpopularofwhichistheServlettechnology[5].ThistechnologygainsitspopularityfromitssuperiorityoverothertechnologiessuchasCGIandPHP[2],[3],[13].Servletsarecumbersometodevelop,however,becausesendingHTMLtagsrequirestheprogrammertocomposethemintoaStringobjectandsendthisobjecttothebrowser.Also,aminorchangetotheoutputrequirestheservlettoberecompiled.Toaddressthisissue,SunMicrosystemsinventedJavaServerPages(JSP)[4].JSPallowsHTMLtagstobeintertwinedwithJavacodeandeachpageistranslatedintoaservlet.AJSPpageisaservlet.However,compilationoccursautomaticallywhenthepageisfirstrequested.Asaresult,changingtheoutputdoesnotneedrecompilation.Inaddition,JSPenablestheseparationofpresentationfromthebusinesslogicthroughtheuseofJavaBeansandcustomtaglibraries.ThenormnowindevelopingJava-basedWebapplicationsistouseservletsalongwithJavaServerPages.Inthelaterdevelopment,thereareanumberofdesignmodelsforbuildingservlet/JSPapplications:Model1,Model2,Struts[12],andJSF[6].Model1andModel2werefirstmentionedintheearlyspecificationsofJSP.Model1strictlyusesJSPpages,withnoservlets,andModel2usesthecombinationofbothservletsandJSPpages.ThetermsofModel1andModel2havebeenusedeversince.Model1is712B.KurniawanandJ.Xuesuitableforprototypesandverysmallapplications,andModel2istherecommendeddesignmodelformediumsizedandlargeapplications.AsModel2gainedmoreacceptancesintheindustry,anopensourceinitiativetobuildtheStrutsFrameworkwasinitiated.StrutsperfectsModel2byprovidingthecontrollerpartoftheModel-View-ControllerofModel2.Inaddition,Strutsprovidesbetterpagenavigationmanagementandseveralcustomtaglibrariesformorerapiddevelopment.Despiteitssteeplearningcurveandthefactthatitwasneverdefinedinanyspecification,StrutshasbeengainingpopularityasthealternativetoModel2.JavaServerFaces[6]isbuiltundertheJavaCommunityProcessunderJSR-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.2JavaWebDevelopmentIssuesAllJavaWebdevelopmentusestheServlettechnologyastheunderlyingtechnology.Assuch,allJavaWebapplicationshavecertainissuesthatneedtobeaddressed:−UserInterface.TheuserinterfaceiswhattheclientbrowserrendersasHTMLtags.Anyserver-sidecomponentusedintheapplicationmustbeencodedintothecorrespondingHTMLelements.Besidesfordisplayingthecontentanddata,theuserinterfaceisalsoresponsibleinreceivinginputfromtheuser.−InputValidation.Userinputneedstobevalidated.Therearetwotypesofinputvalidation,server-sideandclient-side.Asthenameimplies,theserver-sideinputvalidationisperformedontheserveraftertheinputreachestheserver.Client-sideinputvalidationisdoneonthebrowser,usuallybyusingJavaScriptoroth

1 / 11
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功