已阅读5页,还剩9页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
毕业设计说明书英文文献及中文翻译班 级: 学号: 姓 名: 学 院: 专 业: 指导教师: 2外文参考文献原文1 Struts Framework Based on MVCIn the traditional Web application, Java Server Pages(JSP) pages are responsible for handling all things, for example, receiving requests, executing business logics, choosing the next page. These complicated things may lead to chaos of JSP pages codes and be harmful for the extension and maintenance of pages. The Model-View-Controller (MVC) mode separates the programming codes into three different areas, which has solved the above problem. MVC can realize J2EE application systems stratification and the loose coupling of three layers or multilayer, and it is a realization way of orienting dynamic content. The MVC mode divides application into three core components of Model, View and Controller.Struts is a realization of MVC. It is an open source Web application framework and uses Servlet and JSP marks that belong to the J2EE norm as a part of the realization. Struts inherits MVC characteristics and realizes some corresponding changes and extension according to J2EE traits. Struts separates Java codes of JSP by Java Bean and Action class to be the MVC mode, transmits data among the three partitions of Model, View and Controller, demonstrates the connection between various classes and JSP pages by configuration files finally and it intends to realize the separation of presentation layer, business layer and data layer. The Struts structure is shown in Figure 1.The Model contains the business logic that exchanges data with a persistence layer. The View is in charge of producing what is directly visible to the user, e.g. web pages. The Controller is the layer that receives requests from clients, determines what business logic takes place and where to go next. In the Struts framework, the Model uses Java classes for the business logic. The View can be implemented with JSP and the Tag lib of Struts. The Controller is a J2EE component known as Servlet, more specifically an ActionServlet object, which determines what or when logic gets executed and where the control should get directed.Figure 1. Struts structure 2 Hibernate Framework Based on ORMWorking with both the object-oriented software and the relational database is a complicated task with Java Database Connectivity (JDBC) because there is mismatch between how data is represented in objects versus relational database. So with JDBC, developers have to write pure the Structured Query Languag (SQL) statements to map an object models data representation to a relational data model and its corresponding database schema.2.1 Introduction of HibernateHibernate is a flexible and powerful Object-Relational Mapping (ORM) solution to map Java classes to database tables. It is a powerful, high performance object-relational persistence and query service. Hibernate allows developers to express queries in its own portable SQL extension (Hibernate Query Language (HQL)3, as well as in native SQL, or with an object-oriented criteria and example Application Programming Interface(API). Hibernate itself takes care of this mapping using XML files so developers dont need to write code for this.Hibernate is an open source and it is free to use for both development and production deployments, which is a bridge between Java application and relational database and takes charge of mapping between Java objects and relational data. The inside of Hibernate packs the operation of accessing database by JDBC, which provides API of object-oriented database access to upper layer application. So developers can use the object programming thought to operate database sufficiently, caring for the bottom database structure unnecessarily.Hibernate relieves the developer from 95 percent of common data persistence related programming tasks, compared to manual coding with SQL and the JDBC API4. And it can integrate various Web server or application server, and nearly support all popular databases server.2.2 Principle of HibernateFigure 2. Hibernate systematic structureAs shown in figure 2, Hibernate lies in the middle layer that is between application and database .In the provided persistent service, Hibernate maps class to rows of datasheet by properties and mapping files of class (mapping.xml) itself. Application interacts with database by Persitstent Object (PO) to handle data directly.3 The Integration of Struts and HibernateIn the open source frameworks, for the presentation part, Tapestry has the powerful and natural combination of pages, its document is too conceptional to benefit programming. And its learning curve was too steep and so on. For the logic part, Spring has a good integration function, but there is a lack of public controller. And EJB depends on the EJB containers, at the same time, it is realized complicatedly. While Struts has been applied extensively because of its advantages.At present, most of systems apply the relational databases mainly, while Java is an object-oriented language essentially. In Model part of Struts framework application, using SQL and JDBC to operate databases when storing and fetching objects reduces programming efficiency and the systematic maintainability. Traditional J2EE-based application applies heavyweight framework based on EJB that adapts to the large enterprise development, while development and debugging by EJB container need to consume a plenty of time and high price. EJB3 improves the disadvantages of original EJB, but its application is not mature yet.Hibernate can substitute Container-Managed Persistence (CMP) to accomplish heavy responsibility of permanence in J2EE framework of applying EJB.In a word, Hibernate can resolve the difficulties coming from using traditional CMP, JDBC and Data Access Object(DAO) in a technological development. For reducing the coupling of code and raising systematic development efficiency, this paper suggests J2EE application development tactics based on Struts and Hibernate.The Struts design shows the MVC framework sufficiently, which all control flows need a configuration file (Struts-config.xml) to manage, and which is convenient to maintain. The integration of Struts and Hibernate is that Hibernate solves the model layer of Struts, which makes developers operate Java objects instead of database. The integration shows the object-oriented thought sufficiently and solves some problems of the database operation in traditional J2EE well.3.1 Flow of FrameworkThe flow of integration framework based on Struts and Hibernate is shown in Figure 3. At first, users send Http requests by Browser, then Http requests are accepted by ActionServlet of the control component in business layer, then gave to RequestProcessor which gets corresponding Action from ActionMapping by request URL3. Besides, ActionForm packs JSP pages, which can make a checking to data of datasheet if it is needed, send back ActionErrors to visual pages if there are mistakes and transfer the data of pages to Action if it passes validation.Request Processor transfers the “execute” method of Action and the method transfers the business logic module. Hibernate accomplishes interaction of databases and JavaBean. The operation of processing business logic interacts with database by data permanence layer and field object layer. The “execute” method of Action will return ActionForward objects that are accepted by ActionServlet after executing.3.2 Systematic Structure of the Integration FrameworkThe EIS layer of the multi-layer J2EE systematic structure can be partitioned into the data permanence layer and the data resource layer. It means a system can be divided into five layers as a whole.Client Layer: This layer runs in the Browser of users machines and handles interaction with users, transmits and shows messages to users. J2EE platform supports different type users including HTML users, Java Applets, Java application, etc.Presentation Layer: This layer works in J2EE Web container, produces the systematic representation logic, handles users requests and makes the responses. The entire Web is built on Struts framework, in which the View component is composed of JSP/HTML pages whose data is expressed by ActionForm Bean, the Controller component is composed of ActionServlet united Struts-config.xml and Action Classes, and the Model component is realized by business logic layer.Business Logic Layer: This layer accomplishes the required business of system, provides the required business method to presentation layer. It can receive data from client programs and save them to the storage equipment after proper disposal, read data from the data storage equipment, then send them out to client programs.This layer is composed of Business Objects (BO) such as JavaBean and session EJB.Figure 3. Flow chart of the integration framework based on Struts and Hibernate第 0 页 共 14 页外文参考文献译文1 基于MVC的Struts框架在传统的Web应用程序,Java服务器页面(JSP)页面负责处理所有的事情,例如,接收请求,执行业务逻辑,选择下一个页面。这些复杂的事情,可能会导致混乱JSP 页面编码和有害的扩展和维护的JSP页面。模型-视图-控制器(MVC)模式编程代码分离成三个不同的区域,它已经解决了上述问题。 MVC可以实现J2EE应用程序的系统的分层和三层或多层的松散耦合,它是一个实现的定向动态内容的方式。 MVC模式把应用程序分成三个核心部件的模型,视图和控制器。Struts是一个MVC实现。它是一个开源Web应用框架,使用Servlet和JSP标记属于J2EE规范的一部分实现。的Struts继承了MVC的特点和根据J2EE性状,实现一些相应的变化和扩展。 Struts的分离JSP的Java代码的Java Bean和Action类是MVC模式,数据传输三者间的分区模型,视图和控制器,演示各种类和JSP页面之间的连接配置文件,终于和它打算实现表现层,业务层和数据层的分离。 Struts的结构示于图1。该模型包含业务逻辑交换数据持久层。查看是负责生产的,什么是直接对用户可见,例如网页。控制器层,接收来自客户端的请求,决定哪些业务逻辑需要的地方,下一站去哪里。在Struts框架中,模型用业务逻辑的Java类。 JSP和Taglib是Struts的视图可以实现。该控制器是被称为Servlet的J2EE组件,更具体一个ActionServlet的对象,这就决定什么逻辑被执行时,应该得到控制。图1.Struts结构2 基于ORM的Hibernate框架Java数据库连接(JDBC),面向对象的软件和关系数据库的工作是一项复杂的任务,因为数据是如何表示的对象与关系数据库之间存在不匹配。因此,使用JDBC,开发人员必须写纯结构化查询语言开发(SQL)语句对象模型的映射数据表示关系数据模型及其相应的数据库架构。2.1 Hibernate介绍Hibernate是一个灵活和强大的对象-关系映射(ORM)的解决方案,Java类映射到数据库表。这是一个强大的,高性能的对象关系持久性和查询服务。Hibernate允许开发人员在其自己的便携式SQL扩展来表达查询(Hibernate查询语言(HQL),以及在本地的SQL,或面向对象的标准和示例应用程序编程接口(API)。Hibernate自身需要照顾这个映射使用XML文件,以便开发人员不需要编写代码。Hibernate是一个开放源代码和用于开发和生产部署,这是一个桥梁Java应用程序关系数据库之间和负责的Java对象和关系数据之间的映射,它是免费的。里面的Hibernate包JDBC,它提供了面向对象的数据库访问到上层应用的API访问数据库的操作。因此,开发人员可以使用对象编程思想,充分操作数据如图2所示,休眠在于中间层和应用程序之间提供了持续的服务,Hibernate的映射类类的属性和映射文件(mapping.xml中)本身的数据表行database。应用程序与数据库由持久化对象(PO)直接处理数据。库,关怀不必要底层数据库结构。Hibernate的减轻了开发人员常见的数据持久化相关的编程任务的95,比手动编码的SQL和JDBC API。它可以集成各种Web服务器或应用服务器,几乎支持所有流行的数据库服务器。2.2 Hibernate标准图2.Hibernate系统结构如图2所示,休眠在于中间层和应用程序之间提供了持续的服务,Hibernate的映射类属性和映射文件(mapping.xml中)本身的数据表行database。应用程序与数据库由持久化对象(PO)直接处理数据。3 Struts和Hibernate的整合在开源框架,用于演示的一部分,代理路由算法具有强大能自然的和网页结合,其文件是太概念性受益编程的。其学习曲线太陡等。Spring的逻辑部分,具有良好的整合功能,但是缺乏公众控制器。和EJB 依赖于EJB容器,在同一时间,实现复杂。虽然Struts已经被广泛应用,因为它的优势。目前,大多数的系统关系数据库应用为主,而Java是一种面向对象的语言本质。在Struts框架的应用程序,使用SQL和JDBC来操作数据库存储和获取对
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024-2030年中国汽配城行业发展模式规划分析报告
- 2024-2030年中国汽车晴雨挡行业市场运营模式及未来发展动向预测报告
- 2024-2030年中国汽车型材密封件行业产销需求与投资盈利预测报告
- 2024-2030年中国水转印纸行业发展状况及前景趋势分析报告
- 2024-2030年中国水域水面清扫船行业发展态势及未来投资策略建议报告
- 2024年氮气项目提案报告
- 2022年大学统计学专业大学物理下册月考试卷B卷-附解析
- 2022年大学土建专业大学物理二月考试题B卷-附解析
- 班级图书管理制度与家庭阅读推广
- 政府部门帮办代办制度实施指南
- 住院医师规范化培训临床小讲课指南(2021年版)
- 执行实务一百问
- 成人癌性疼痛护理-中华护理学会团体标准2019
- 《思想道德与法治》2021版第四章
- 找出划线部分读音不同的单词
- 产品销售培训心得
- 二年级下册道德与法治教案-3.2节约粮食北师大版
- 急诊剖宫产分级
- 曾国藩为人识人及用人
- 双喜公司双喜世纪婚礼策划活动
- 色貌与色貌模型
评论
0/150
提交评论