您好,欢迎访问三七文档
PraveenGuptaet.al./(IJCSE)InternationalJournalonComputerScienceandEngineeringVol.02,No.04,2010,1047-1051MVCDesignPatternforthemultiframeworkdistributedapplicationsusingXML,springandstrutsframeworkPraveenGuptaResearchScholar,SinghaniaUniversityPacheriBari,Rajasthan,Indiapraveen2gupta@gmail.comProf.M.C.GovilGovt.MahilaEngineeringCollegeAjmer,Rajasthan,Indiagovilmc@yahoo.comAbstract—Themodelviewcontroller(MVC)isafundamentaldesignpatternfortheseparationbetweenuserinterfacelogicandbusinesslogic.SinceapplicationsareverylargeinsizethesedaysandtheMVCdesignpatterncanweakthecouplingamongthedifferentapplicationtiersofapplication.thispaperpresentsawebapplicationframeworkbasedonMVCinJ2EEplatform,andextendsitwithXMLsothattheframeworkismoreflexible,expansibleandeasytomaintain.Thisisamultitiersystemincludingpresentationlayer,businesslayer,datapersistencelayeranddatabaselayer.Thisseparatecodes,andimprovemaintainabilityandreusabilityoftheapplication.Inthispaper,weimplementedMVCusingspringandstrutsframework.OurresearchstudyshowthatapplyingmultipleframeworktodesigntheapplicationsusingMVCconceptsmakesapplicationseasiercomparetoasingleframework.IndexTerma:MVC,Spring,XMLI.INTRODUCTIONWebistheverycomplexissuesthesedays.Sincethedesireofthecompaniesandorganizationsareincreasingsothecomplexityandtheperformanceofthewebprogrammingmatters.Complexitywiththedifferenttypesofcommunicationdevicesisincreasing.Thebusinessisdemandingapplicationsusingthewebandmanycommunicationdevices.Sowiththeincreaseloadofthedataontheinternetwehavetotakecareofthearchitectureissue.LetusdiscussinbrieftheresearchdonesofarinMVC.1.1NOMVC:InTheinitialphaseofthewebdevelopmentthepageswereusedtobedesignedinthehtml.Htmlistheplaintextonly.Thiswasthefirstmarkuplanguagewhichcanworkontheinternet.AndtodaystillsitworksasbuildingblockfortheallInternetbasedprogramminglanguages.Theuserhastointeractwiththestaticpages.Theinformationwrittenonthepageshadtochangemanually.Asthetimegrowsthedemandarisesforalanguagethatcaninteractwiththeuserandpagecanbechangedaspertherequirementoftheuser.1.2MVCModel1:ThefirstmajorchangeinthearchitecturecomeswiththeintroductionoftheMVCModel1Architecture.Thisarchitecturewascompletelybasedonthepagecentricapproach.InthismodelaJavaServerPagestoprogramtocontrolthePresentation,BusinessLogicandflowoftheprogram.InthismodeltheconceptoftheBusinessLogicwasintroduced.ThebusinesslogicwashardcodedintheformoftheJavaBeansandscriptletsandexpressions.AllthiscodeswasusedtowritewithintheJSPpage.Letusassumeacasewhenwewanttotransfertheflowofthejspapplicationbasedonthedatawereceivedfromtheinput. Figure 1 PageNavigationinMVC-1ArchitectureA.JSPB.JSPC.JSPDataBaseISSN:0975-33971047PraveenGuptaet.al./(IJCSE)InternationalJournalonComputerScienceandEngineeringVol.02,No.04,2010,1047-10511.3MVCModel2:Themodel1architecturewasabletosolvesomeoftheproblemofthewebandinternetprogrammingbutstilltherewerealotofthingsmissingfromit.Itwascenteredonthenavigationofthejsppagessotherewasthescopeofthefurtherdevelopmentinthearchitecturepointofview.DuringthisprocessthenextdevelopmentwastheModel2architecture.ThisproblemwassolvedusingtheServletandJSPtogether.TheServesthandlestheInitialrequestandpartiallyprocessthedata.Itsetupthebeansthenforwardtheresulttotheoneofthejsppage.TheServletdecidetheoneofthepagetobedisplayedfromthelistofpages. Figure 2 MVC-2architectureInthisModel2architecturetheJSPPageswereusedtoPresentationpurposeonly.TheBusinesslogichasbeenremovedfromthepage.ThismakesthepageseasiertorepresentandlightweightpageswhichwereeasytodisplayontheinternetInthismodelallControlandapplicationlogicwerehandledbytheServlet.TheServletwaswritteninthejavaprogramminglanguage.SoitwasalsoeasiertohandletheprogrammingpartoftheServlet.InthisscenariotheServestbecomesthepowerfullforthecompleteapplicationandIthasemergedasthecenterpointfortheapplication.Inthemodel2architecturetheServletbecomesthegatekeeperfortheallcommontasks.Itprovidesthecommonserviceslikeauthentication,authorization,errorcontrolandfollowoftheapplication.Thisarchitecturehavesolvedthemostoftheproblems.ButstillthereweremanynewissuesemergedwhileapplyingthisarchitectureII.APPLYINGARCHITECTUREWITHMULTIPLEFRAMEWORKSWebandInternetisevergrowingareaandthedemandsfortheapplicationsaregrowing.Asingleframeworkisnotcapabletohandlethearchitectureoftheapplication.Tomeetthecurrentsrequirementoftheapplicationsit’snecessarytodesignaarchitecturetoimplementtheframeworks.Strutsframeworkhavebeendesignedanddevelopedforthefrontendcontrolofthewebapplications.Itprovidesthevariousfeaturesfortheapplicationsthatinteracttotheusers.ItalsofollowstheMVC2designfeatures.SpringFrameworkisthedesignedtohandlethevarioustasks.Thespringworkforthedesktopandinternetbasedapplicationsalso.ItfollowstheprincipalsoftheMVC2.ThesimultaneoususeoftheStrutsandspringframeworksinthesingleapplicationwiththeapplyingtheMVCDesignprincipalssothatwecanImprovetheperformanceoftheapplications.StrutsFrameworkconsistsofthreemajorblocks,Describedinbriefasfollows.Figure 3 Struts Model ArchitectureFirstisTheViewBlockwhichco
本文标题:MVC-Design-Pattern-for-framework-distributed-appli
链接地址:https://www.777doc.com/doc-2724015 .html