ImageVerifierCode 换一换
格式:DOCX , 页数:10 ,大小:24.74KB ,
资源ID:9664349      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9664349.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(三大框架外文翻译.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

三大框架外文翻译.docx

1、三大框架外文翻译一种基于Hibernate、Struts和Spring的J2EE应用开发框架随着Java技术的逐渐成熟与完善,作为建立企业级应用的标准平台,J2EE平台得到了长足的发展。借助于J2EE规范中包含的多项技术:Enterprise JavaBean(EJB)、Java Servlets(Servlet)、Java Server Pages(JSP)、Java Message Service(JMS)等,开发出了许多应用系统。但是,在传统J2EE应用的开发过程中也出现了一些问题:(1)数据模型和逻辑模型之间的矛盾。目前使用的数据库基本上都是关系型数据库,而Java本质上是一种面向对象

2、的语言,对象在存储和读取时使用SQL和JDBC进行数据库操作,降低了编程的效率以及系统的可维护性;(2)传统的J2EE应用多采用基于EJB的重量级框架,这种框架适合于开发大型企业应用,但是使用EJB容器进行开发和调试需要耗费大量时间。为了降低代码的耦合性,提高系统的开发效率,本文提出了一种基于Struts框架、Hibernate框架和Spring框架的J2EE应用开发策略。Hibernate 框架Hibernate是一个数据持久层框架,是一种实现对象和关系之间映射(O/R Mapping)的工具,它对JDBC进行了轻量级的对象封装,使程序员可以使用对象编程思想来操作数据库。它不仅提供了从Jav

3、a类到数据表的映射,也提供了数据查询和恢复机制。相对于使用JDBC和SQL来操作数据库,使用Hibernate能大大的提高实现的效率。Hibernate框架用配置文件的形式来定义Java对象和数据表之间的映射关系,同时在更深的层面将数据表之间的关系解释为Java对象之间的继承及包含等关系。通过使用HQL语句将复杂的关系算法用对象的方式描述,在很大程度上简化了对数据的查询,加快了开发的效率。在Hibernate中有一个简单而直观的API,用于对数据库所表示的对象执行查询。要创建或修改这些对象,只需在程序中与它们进行交互,然后告诉Hibernate保存即可。这样,大量封装持久化操作的业务逻辑不再需

4、要编写烦琐的JDBC语句,从而使数据持久层得到了极大的简化。 用Struts实现MVC架构 MVC(Model-View-Controller)由Trygve Reenskaug提出,首先被应用在SmallTalk-80环境中,是许多交互和界面系统的构成基础。根据界面设计可变性的需求,MVC把交互系统的组成分解成模型、视图、控制器三部分。模型(Model)是软件所处理问题逻辑在独立于外在显示内容和形式情况下的内在抽象,封装了问题的核心数据、逻辑和功能的计算关系,独立于具体的界面表达和I/O操作。视图(View)把表示模型数据及逻辑关系和状态的信息及特定形式展示给用户。它从模型获得显示信息,对于

5、相同的信息可以有多个不同的显示形式或视图。控制器(Controller)是处理用户与软件的交互操作的,其职责是控制提供模型中任何变化的传播,确保用户界面于模型间的对应联系;它接受用户的输入,将输入反馈给模型,进而实现对模型的计算控制,是使模型和视图协调工作的部件。通常一个视图对应一个控制器。模型、视图与控制器的分离,使得一个模型可以具有多个显示视图。如果用户通过某个视图的控制器改变了模型的数据,所有其它依赖于这些数据的视图都应反映到这些变化。因此,无论何时发生了何种数据变化,控制器都会将变化通知所有的视图,导致显示的更新。这实际上是一种模型的变化-传播机制。 Struts框架Spring 框架

6、Spring明显区别于其他轻量级application framework, 它将专注于web的支持,与struts 和 webwork有着明显的区别。 在与struts、webwork的对比上,Spring是一个服务于所有层面的application framework:提供了bean的配置基础,AOP的支持,JDBC的提取框架,抽象事务支持等等。它有一个非常显著的特点:在某个层面上如果你不需要Spring的支持,你就可以不使用Spring的class,只使用它的某一部分的功能。 从它的设计理念,你可以看到Spring 帮助你实现了真正的逻辑层和web层的分离。例如:一个校验应用将不用依靠c

7、ontrollers就可以实现。这样的目标更好的重用和易测,过分依靠不必要的容器和框架将不能实现这一点。当然,Spring 有自己的web支持和通常框架模式细致完整。然而,Spring替换struts、webwork或者其他的web方案非常容易。对于Spring的web支持或者不同的地方,Spring 允许你在web容器里面建立一个中间层,在测试环境或者标准独立的应用里面来设置重用你的商务逻辑.还有在J2EE环境里面,你的商务逻辑不必依靠容器提供的服务,像JTA ,EJB的支持。良好的构架的web应用可以运行在任何容器上,如,Tomcat 或者 Resin。值得注意的是,Spring 不是和已

8、经存在的解决方案进行竞争. 我们鼓励结合标准的技术,如,Servlet,JSP, JTA,JNDI,JDBCand JDO和非常匹配的工具,如,Hibernate, Velocity, Log4J, and Cauchos Hessian/Burlap。这个框架的的设计思想是在你的应用需要改良的时候,你将会做一些技术的选择,例如,如果你需要分布式事务处理,你可能需要用Spring的Jta TransactionManager 来实现JTA服务。或者用DataSource TransactionManager or HibernateTransactionManager 来实现的单个数据库交换。

9、Spring 框架通过配置操作mappings,展示resolution,本地化和模版集成围绕着分派请求操作的servlet-DispatcherServlet设计的。缺省的操作是一个非常简单的控制接口, 他只提供了ModelAndView handleRequest (request, response)方法。这将用于一个应用的控制,但是,如果你想包含多个层次的控制,AbstractController,AbstractCommandController, MultiActionController,SimpleFormController,AbstractWizardFormControl

10、ler将帮助你完成.应用控制将代表那些子系统。注意,你可以选择一个适当的基类:如果你没有web form,你就不必用FormController,这就是和Struts最大的不同。你可以通过命令或者form对象来操作任何对象,这不需要接口工具或者一个基础类的驱动。Spring的数据绑定非常灵活。举例来说,它描述了具有在应用范围内的校验错误的输入机制,但不是系统错误,所以在你的form对象里面你不必复制你的业务对象的spring属性,只操作出错的子任务,或者适当地转换spring。换句话说,它通常可以很好的直接绑定你的业务对象。 这也是和struts围绕请求基础类Action 和 ActionFo

11、rm (每个action操作类型) 建立主要的不同之一。对比WebWork,Sping更多的区别在于对象角色:Spring支持控制器的感念,一个操作命令或者form对象和得到数据传递给视图的模式,这个模式通常包含命令和form对象,但有时也包含任意的参考数据。换句话说,一个WebWork Action联合所有这些角色到一个单独的对象。WebWork允许你用已经存在的业务对象作为你form的一部分,但是只生成各自Action 的bean属性。最后,操作请求的Action 实例在一个视图里面获得付值和form population。然而,参考数据也需要作为Action 的属性被模拟。关于视图:Sp

12、ring的视图方案非常的灵活。一个控制器执行可以通过response 返回ModelAndView对象null就可以直接写到一个视图里,在一般情况下,一个ModelAndView实例结合了一个view和一个model Map,包含了bean name 和通讯对象(像命令或者form,参考数据等等)。View名称是非常高端的配置,不是通过bean name,一个properties 文件就是通过你自己的ViewResolver.这个抽象的model Map 允许你在视图层面完成提取,没有任何的争辩JSP/Velocity或者其他,每一种都可以直接完整使用.这个model Map 还可以简单得得到

13、适当的格式化数据的转换,像JSP 请求属性或者Velocity 模版模式. 如果你不想用Spring的 web MVC,但是想借用Spring嫁接其他的解决方案,你可以非常简单地通过Spring继承你自己的web 框架,你可以非常简单地通过ContextLoaderListener启动一个Spring root application context,并且,通过Struts 或者WebWork 的action 利用ServletContext 属性(或者Spring 的helper方法)存取它。值得注意的是, 这里没有任何的plugins被调用,因此没有专门的集成:来自web层的视图, 你可以

14、简单的将Spring作为一个管理application context 实例入口点的类库。所有你注册bean和Spring服务都可以在不需要Spring的web MVC的情况下都可以轻松掌握。Spring不是和Struts 、WebWork这些应用进行竞争,它将作为一个纯web框架应用于很多领域,因为它不需要配置数据存储和事务操作,所以,你可以利用Spring提供的中间层和数据存储层来丰富你的应用,甚至用JDBC或者Hibernate进行事务抽象。如果仅仅聚焦于web支持,Spring的一些显著特点是清楚分离:controller,validator,command object,form o

15、bject,model object,和 DispatcherServlet,handler mapping vs view resolver等等强大而且直接的框架和作为JavaBeans的应用配置,包括简单的参照和应用内容,例如,从web控制器到业务对象和数据校验。适应性,无论什么样的控制器你都需要得到代替Action/ActionForm所做的每件事情的方案(简单,命令,form,范例,多重action,或者定制一个) 重用业务逻辑代码,不需要复制,你可以用已经有的业务逻辑对象作为命令或则form对象代替反射特定的ActionForm子类。可订制的绑定和数据校验作为应用级的输入机制的错误校

16、验,固定日期和数字绑定,例如,通过手动检查和转换业务对象来替换单个的string。可订制的操作,可订制的视图方案:通过name/value Map灵活的模型传送,用一个简单的方法从简单到复杂操作映射和视图方案策略。以在J2EE应用中非常普遍的用户登录过程为例来说明上述体系结构是如何具体运用的。登录的流程非常清晰:用户从登录页面login.jsp输入登录信息,系统对登录信息进行验证,如果正确则成功登录,否则提示相应错误信息。在开发过程中,使用Eclipse做为开发环境,同时加载了对Struts、Spring及Hibernate提供更好的控制和支持的第三方插件MyEclipse,Web服务器使用T

17、omcat,数据库选用了Mysql。首先对Hibernate进行配置,只需要对系统自动生成的hibernate.cfg.xml进行修改,配置好数据库连接的各种参数以及定义数据映射文件。由于Hibernate所带的连接池主要用于测试,性能不是很好,可以通过JNDI将其修改为使用Tomcat的连接池。A Development Frame Application Based on the Hibernate、the Struts and the Spring J2EEOne preface along with the Java technique of gradual mature and pe

18、rfect. Be establishment business enterprise class application of standard terrace,the J2 EE terrace got substantial of development .Several technique asked for help from to include in the J2 EE norm : Enterprise JavaBean (EJB), Java Servlets (Servlet), Java Server Pages(JSP), Java Message Service(JM

19、S)etc., development many application system.But, also appeared some problem in the tradition J2 the EE the application of the development the process:1)the antinomy of of data model and logic model. Currently the database of usage basically and all is relation type database, but the Java be essentia

20、lly a kind of the language which face to object, object at saving with read usage SQL and JDBC carry on a database operation and lowered plait distance of efficiency and system of can maintenance;2)tradition of J2 EE application much the adoption is according to the EJB heavy weight frame, this kind

21、 of frame suitable for develop a large business enterprise application, but usage the EJB container carry on development and adjust to try to need to be waste a great deal of time.For lowering the Ou of code to match sex, exaltation system of development efficiency, this text put forward one kind EE

22、 according to the J2 of the Struts frame 、the Hibernate frame and the Spring frame application development strategy. The Hibernate FrameUse the Struts realization MVC structure MVC(Model-View-Controller) is put forward by the Trygve Reenskaug, first drive application in the environment SmallTalk-80,

23、 is many to hand over with each other with interface system of constitute foundation. According to the need of variable of the interface design, MVC hand over with each other constitute of system to resolve into model and see diagram, controller three part. Model(Model) is software processing proble

24、m logic at independence in outside manifestation under contents and form circumstance of inside abstract, packed the core data, logic of problem and function of calculation relation, independence in concrete of interface expression and I/O operation. See diagram(View) mean information and particular

25、 form demonstration of model data and logic relation and appearance to the customer. It acquire a manifestation information from the model, there can be many for homology of information dissimilarity of manifestation form or see diagram. The controller(Controller) is a processing the customer hand o

26、ver with software with each other operation of, its job is control provide model in any variety of dissemination, insure a customer interface among the model of rightness should contact; It accept a customer of importation, give the importation feedback model, then realization compute model control,

27、 is make model and see diagram to moderate work of parts. Usually 1 see a diagram rightness should a controller. Model, see separate of diagram and controller, make a model be able to have many manifestation to see diagram. If the customer pass a certain see the controller of diagram change the data

28、 of model, all other dependence in these see of data diagram all should reflection arrive these variety. When therefore and regardless occurrence what data variety, controller all would variety notice ally see diagram, cause manifestation of renewal. This is actually a kind of variety of model-disse

29、mination mechanism. The Struts Framethe Spring FrameSpring isnt particularly a web framework but a generic lightweight application framework with dedicated web support, and show the architectural differences to Struts and WebWorkIn contrast to Struts or WebWork, Spring is an application framework fo

30、r all layers: It offers a bean configuration foundation, AOP support, JDBC abstraction framework, abstract transaction support etc. It is a very non-intrusive effort: Your application classes do not need to depend on any Spring classes if not necessary, and you can reuse every part on its own if you

31、 like to. From its very design, the framework encourages clean separation of tiers, most importantly web tier and business logic. e.g: the validation framework does not depend on web controllers. Major goals are reusability and testability: Unnecessary container or framework dependencies can be cons

32、idered avoidable evils.Of course, Springs own web support is nicely integrated with the frameworks general patterns. Nevertheless, replacing the web solution with Struts, WebWork, or the like is easy. Both with Springs web support or a different one, Spring allows for building a true dedicated middl

33、e tier in the web container, with the option to reuse exactly the same business logic in test environments or standalone applications. And within J2EE, your business logic will not unnecessarily depend on container services like JTA or EJB - allowing complex, well-architected web applications to run in a simple container like Tomcat

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1