您好,欢迎访问三七文档
咸宁学院本科毕业论文:外文翻译1外文资料所译外文资料:①作者:DanMalks②书名:ProfessionalJSP③出版时间:2000.7.26④所译章节:Chapter1212.1IntroductoryGoodWebapplicationdesigntriestoseparatebusinessobjects,presentation,andmanipulationoftheobjectsintodistinctlayers.OnebenefitofusingJavaServerPagestechnologyisthatitallowsustoseparatetheroleofaWebdesignermoreclearlyfromthatofasoftwaredeveloper.Whileonasmall-scaleproject,oneindividualmayoccupybothroles,onalargerproject,theyarelikelytobeseparateanditisbeneficialtoseparatetheirworkflowsasmuchaspossible.DesigningthearchitectureforyourWebapplicationiscrucialtothisseparation.12.2JSParchitectureWewillexamineavarietyofwaystoarchitectasystemwithJavaServerPages,servlets,andJavaBeans.Wewillseeaseriesofdifferentarchitectures,eachadevelopmentoftheonebefore.Thediagrambelowshowsthisprocessinoutline;theindividualpartsofthediagramwillbeexplainedinturnlaterinthisarticle.JSParchitecture:咸宁学院本科毕业论文:外文翻译2WhenSunintroducedJavaServerPages,somewerequicktoclaimthatservletshadbeenreplacedasthepreferredrequesthandlingmechanisminWeb-enabledenterprisearchitectures.AlthoughJSPisakeycomponentoftheJava2PlatformEnterpriseEdition(J2EE)specification,servingasthepreferredrequesthandlerandresponsemechanism,wemustinvestigatefurthertounderstanditsrelationshipwithservlets.OthersectionsofProfessionalJSPexplaintheimplementationdetailsofJSPsourcetranslationandcompilationintoaservlets.UnderstandingthatJSPisbuiltontopoftheservletAPI,andusesservletsemantics,raisessomeinterestingquestions.Shouldwenolongerdevelopstand-aloneservletsinourWeb-enabledsystems?IstheresomewaytocombineservletsandJSPs?Ifso,wheredoweplaceourJavacode?Arethereanyothercomponentsinvolvedintherequestprocessing,suchasJavaBeans?Ifso,wheredotheyfitintothearchitectureandwhattypeofroledotheyfulfill?Itisimportanttounderstandthat,althoughJSPtechnologywillbeapowerfulsuccessortobasicservlets,theyhaveanevolutionaryrelationshipandcanbeusedinacooperativeandcomplementarymanner.Giventhispremise,wewillinvestigatehowthesetwotechnologies,eachaJavaStandardExtension,canbeusedco-operativelyalongwithothercomponents,suchasJavaBeans,tocreateJava-basedWeb-enabledsystems.WewillexaminearchitecturalissuesastheyrelatetoJSPandservletsanddiscusssomeeffectivedesignswhilelookingatthe咸宁学院本科毕业论文:外文翻译3tradeoffsofeach.Beforejumpingdirectlyintoadiscussionofspecificarchitectures,though,wewillbrieflyexaminetheneedtodevelopavarietyofarchitectures.12.3CodefactoringandroleseparationOneofthemainreasonswhytheJavaServerPagestechnologyhasevolvedintowhatitistoday(andit'sstillevolving)istheoverwhelmingtechnicalneedtosimplifyapplicationdesignbyseparatingdynamiccontentfromstatictemplatedisplaydata.ThefoundationforJSPwaslaiddownwiththeinitialdevelopmentoftheJavaWebServerfromSun,whichusedpagecompilationandfocusedonembeddingHTMLinsideJavacode.Asapplicationscametobebasedmoreonbusinessobjectsandn-tierarchitectures,thefocuschangedtoseparatingHTMLfromJavacode,whilestillmaintainingtheintegrityandflexibilitythetechnologyprovided.InChapter5,JSPSessions,inProfessionalJSP,wesawhowbeansandobjectscanbeboundtodifferentcontextsjustbydefiningacertainscope.Goodapplicationdesignbuildsonthisideaandtriestoseparatetheobjects,thepresentation,andthemanipulationoftheobjectsintodistinct,distinguishablelayers.AnotherbenefitofusingJSPisthatitallowsustomorecleanlyseparatetherolesofaWebproduction/HTMLdesignerindividualfromasoftwaredeveloper.RememberthatacommondevelopmentscenariowithservletswastoembedtheHTMLpresentationmarkupwithintheJavacodeoftheservletitself,whichcanbetroublesome.Inourdiscussion,wewillconsidertheservletsolelyasacontainerforJavacode,whileourentireHTMLpresentationtemplateisencapsulatedwithinaJSPsourcepage.ThequestionthenarisesastohowmuchJavacodeshouldremainembeddedwithinourJSPsourcepages,andifitistakenoutoftheJSPsourcepage,whereshoulditreside?Let'sinvestigatethisfurther.OnanyWeb-basedproject,multiplerolesandresponsibilitieswillexist.Forexample,anindividualwhodesignsHTMLpagesfulfillsaWebproductionrolewhilesomeonewhowritessoftwareintheJavaprogramminglanguagefulfillsasoftwaredevelopmentrole.Onsmall-scaleprojectstheserolesmightbefilledbythesameindividual,ortwoindividualsworkingcloselytogether.Onalargerproject,theywilllikelybefilledbymultipleindividuals,whomightnothaveoverlappingskillsets,andarelessproductiveifmadetoodependentontheworkflowoftheother.IfcodethatcouldbefactoredouttoamediatingservletisincludedinsteadwithinHTMLmarkup,thenthepotentialexistsforindividualsinthesoftwaredevelopmentroleandthoseintheWebproductionroletobecomemoredependentthannecessaryontheprogressand咸宁学院本科毕业论文:外文翻译4workflowoftheother.Suchdependenciesmaycreateamoreerror-proneenvironment,whereinadvertentchangestocodebyotherteammembersbecomemorecommon.Thisgivesussomeinsightintoonereasonwhywecontinuetodevelopbasicservlets:theyareanappropriatecontainerforourcommonJavacodethathasbeenfactoredoutofourJSPpages,givingoursoftwaredevelopmentteamanareaoffocusthatisaslooselycoupledtoourJSPpagesaspossible.Certainly,therewillbeaneedforthesesameindividualstoworkwiththeJSPsourcepages,butthedependenc
本文标题:外文翻译
链接地址:https://www.777doc.com/doc-5316430 .html