SSH为spring+struts+hibernate的一个集成框架外文翻译.docx

上传人:李司机 文档编号:7048841 上传时间:2024-06-05 格式:DOCX 页数:4 大小:18.95KB
返回 下载 相关 举报
SSH为spring+struts+hibernate的一个集成框架外文翻译.docx_第1页
第1页 / 共4页
SSH为spring+struts+hibernate的一个集成框架外文翻译.docx_第2页
第2页 / 共4页
SSH为spring+struts+hibernate的一个集成框架外文翻译.docx_第3页
第3页 / 共4页
SSH为spring+struts+hibernate的一个集成框架外文翻译.docx_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《SSH为spring+struts+hibernate的一个集成框架外文翻译.docx》由会员分享,可在线阅读,更多相关《SSH为spring+struts+hibernate的一个集成框架外文翻译.docx(4页珍藏版)》请在三一办公上搜索。

1、英文原文SSHisSpring+struts+Hibernateanintegrationframework,isoneofthemorepopularaWebapplicationframework.Spring1.ightweight-fromtwoaspectsintermsofsizeandcostoftheSpringarelightweight.AcompleteSpringframcworkcaninonesizeonlyIMBmultipleJARfilesreleased.AndSpringrequiredprocessingoverheadisnotworthmention

2、ing.Inversionofcontrol-Springthroughaknownasinversionofcontrol(IoC)technologypromotesloosecoupling.WhenusingIoC,anobjectdependonotherobjectswillbepassedinthroughpassiveway,butnottheobjectofitsowntocreateorfindadependentobject.YoucanthinkofIoCandJNDIinstead-nottheobjectfromthecontainerfordependent,bu

3、tindifferentcontainerobjectisinitializedobjectrequestonowninitiativewillrelyontoit.Aspectorientedprogramming-Springprovidesrichsupport,allowedbyseparatingtheapplication*sbusinesslogicandsystemlevelservicecohesiondevelopment.Applicationobjectonlyrealizetheyshoulddo-completebusinesslogic.Theyarenotres

4、ponsibleforothersystemlevelconcerns.Container-Springcontainsandmanagementapplicationobjectconfigurationandlifecycle,inthissense,itisakindofcontainer,youcanconfigureeachofyourbeantobecreated-Basedonareconfigurableprototype(prototype),yourbeancancreateasingleinstanceoreverytimewhentheyareneededtogener

5、ateanewexamples-andhowtheyareinterrelated.However,SpringshouldnotbeconfusedwiththetraditionalheavyweightEJBcontainer,theyareoftenlargeandunwieldy,difficulttouse.StrutsStrutsonModel,ViewandControllerareprovidedwiththecorrespondingcomponents.ActionServlet,thisisStrutscorecontroller,responsibleforinter

6、ceptingtherequestfromtheuser.Action,thisclassistypicallyprovidedbytheuser,thecontrollerreceivesfromtheActionServletrequest,andaccordingtotherequesttocallthemodelbusinesslogicmethodtoprocessingtherequest,andtheresultswillbereturnedtotheJSPpagedisplay.PartMode1ByActionFormandJavaBean,whereActionFormus

7、edtopackagetheusertherequestparameters,packagedintoaActionFormobject,theobjecttobeforwardedtotheActionActionServletActionActionFrom,accordingtowhichtherequestparametersprocessingauserrequest.JavaBeanencapsulatestheunderlyingbusinesslogic,includingdatabaseaccess.PartViewThissectionisimplementedbyJSP.

8、Strutsprovidesarichlibraryoftags,taglibrarycanbereducedthroughtheuseofthescript,acustomtaglibrarycanbeachievedwithModeleffectiveinteraction,andincreasedpracticalfunction.TheControllercomponentTheControllercomponentiscomposedoftwoparts-thecoreofthesystemcontroller,thebusinesslogiccontroller.Systemcor

9、econtroller,thecorrespondingActionServlet.ThecontrollerisprovidedwiththeStrutsframework,HttpServletclassinheritance,soitcanbeconfiguredtomarkServlet.ThecontrollerisresponsibleforallHTTPrequests,andthenaccordingtotheuserrequesttodecidewhetherornottotransfertobusinesslogiccontroller.Businesslogiccontr

10、oller,responsibleforprocessingauserrequest,itselfdoesnothavetheprocessingpower,itcallstheModeltocompletethedeal.ThecorrespondingActionpart.HibernateHibernateisanopensourceobjectrelationmappingframework,ithadaverylightweightJDBCobjectpackage,makesJavaprogrammerscanusearbitraryobjectstomanipulatedatab

11、aseprogrammingthinking.HibernatecanbeappliedinanyuseofJDBCoccasions,canbeintheJavaclientprogramtouse,alsocanbeinServlet/JSPWebapplications,themostrevolutionary,HibernatecanbeappliedintheEJBJ2EEschematoreplaceCMP,completedatapersistence.ThecoreofHibernateinterfacehasatotalof5,are:Session,SessionFacto

12、ry,Query,TransactionandConfiguration.The5coreinterfaceinanydevelopmentwillbeusedin.Throughtheseinterfaces,notonlycanthepersistentobjectaccess,butalsotocarryoutatransactioncontrol.中文翻译SSH为spring+struts+hibernate的一个集成框架,是目前较流行的一种Web应用程序开源框架。Spring轻量一一从大小与开销两方面而言Spring都是轻量的。完整的Spring框架可以在一个大小只有IMB多的JAR

13、文件里发布。并且Spring所需的处理开销也是微不足道的。控制反转一一SPring通过一种称作控制反转(IOC)的技术促进了松耦合。当应用了IoC,一个对象依赖的其它对象会通过被动的方式传递进来,而不是这个对象自己创建或者查找依赖对象。你可以认为IoC与JNDI相反一一不是对象从容器中查找依赖,而是容器在对象初始化时不等对象请求就主动将依赖传递给它。面向切面一一Spring提供了面向切面编程的丰富支持,允许通过分离应用的业务逻辑与系统级服务进行内聚性的开发。应用对象只实现它们应该做的一一完成业务逻辑。它们并不负责其它的系统级关注点。容器一一Spring包含并管理应用对象的配置和生命周期,在这个

14、意义上它是一种容器,你可以配置你的每个bean如何被创建一一基于一个可配置原型(prototype),你的bean可以创建一个单独的实例或者每次需要时都生成一个新的实例一一以及它们是如何相互关联的。然而,SPring不应该被混同于传统的重量级的EJB容器,它们经常是庞大与笨重的,难以使用。Strutsstruts对Model,ViCw和Controller都提供了对应的组件。ActionServlet,这个类是StrUtS的核心控制器,负责拦截来自用户的请求。Action,这个类通常由用户提供,该控制器负责接收来自ActionServlet的请求,并根据该请求调用模型的业务逻辑方法处理请求,并

15、将处理结果返回给JSP页面显示。Model部分由ACtionForm和JavaBean组成,其中ACtionForm用于封装用户的请求参数,封装成ACtiOnFOrm对象,该对象被AetionServlet转发给ACtiOn,Action根据ActionFrom里面的请求参数处理用户的请求。JavaBean则封装了底层的业务逻辑,包括数据库访问等。View部分该部分采用JSP实现。StrUtS提供了丰富的标签库,通过标签库可以减少脚本的使用,自定义的标签库可以实现与ModeI的有效交互,并增加了现实功能。Controller组件Controller组件有两个部分组成一一系统核心控制器,业务逻辑

16、控制器。系统核心控制器,对应ACtionSerVIet。该控制器由StrUtS框架提供,继承HttPSerVlet类,因此可以配置成标注的SerVlet。该控制器负责拦截所有的HTTP请求,然后根据用户请求决定是否要转给业务逻辑控制器。业务逻辑控制器,负责处理用户请求,本身不具备处理能力,而是调用Model来完成处理。对应Action部分。HibernateHibernate是一个开放源代码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,使得JaVa程序员可以随心所欲的使用对象编程思维来操纵数据库。Hibernate可以应用在任何使用JDBC的场合,既可以在JaVa的客户端程序使用,也可以在SerVIet/JSP的Web应用中使用,最具革命意义的是,Hibernate可以在应用EJB的J2EE架构中取代CMP,完成数据持久化的重任。Hibernate的核心接口一共有5个,分别为:SeSSiOn、SessionFactoryQueryTranSaCtiOn和ConfigUration。这5个核心接口在任何开发中都会用到。通过这些接口,不仅可以对持久化对象进行存取,还能够进行事务控制。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号