基于SSH架构的交流社区毕业设计外文翻译

上传人:仙*** 文档编号:150740260 上传时间:2022-09-10 格式:DOC 页数:13 大小:335.56KB
收藏 版权申诉 举报 下载
基于SSH架构的交流社区毕业设计外文翻译_第1页
第1页 / 共13页
基于SSH架构的交流社区毕业设计外文翻译_第2页
第2页 / 共13页
基于SSH架构的交流社区毕业设计外文翻译_第3页
第3页 / 共13页
资源描述:

《基于SSH架构的交流社区毕业设计外文翻译》由会员分享,可在线阅读,更多相关《基于SSH架构的交流社区毕业设计外文翻译(13页珍藏版)》请在装配图网上搜索。

1、毕业设计说明书英文文献及中文翻译班 级: 学号: 姓 名: 学 院: 专 业: 指导教师: 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

2、 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

3、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 th

4、at 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

5、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 log

6、ic 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 Mod

7、el 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.Fig

8、ure 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 J

9、DBC, 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

10、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 an

11、d 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 a

12、nd 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 thoug

13、ht 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 applicat

14、ion 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 datashe

15、et 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 combinatio

16、n 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 complicat

17、edly. 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

18、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 hig

19、h 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 fro

20、m 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

21、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 integra

22、tion 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

23、 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

24、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

25、 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 syst

26、ematic 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

27、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 w

28、hich 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 accomplish

29、es 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 compo

30、sed 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)模式编程代码分离成

31、三个不同的区域,它已经解决了上述问题。 MVC可以实现J2EE应用程序的系统的分层和三层或多层的松散耦合,它是一个实现的定向动态内容的方式。 MVC模式把应用程序分成三个核心部件的模型,视图和控制器。Struts是一个MVC实现。它是一个开源Web应用框架,使用Servlet和JSP标记属于J2EE规范的一部分实现。的Struts继承了MVC的特点和根据J2EE性状,实现一些相应的变化和扩展。 Struts的分离JSP的Java代码的Java Bean和Action类是MVC模式,数据传输三者间的分区模型,视图和控制器,演示各种类和JSP页面之间的连接配置文件,终于和它打算实现表现层,业务层和

32、数据层的分离。 Struts的结构示于图1。该模型包含业务逻辑交换数据持久层。查看是负责生产的,什么是直接对用户可见,例如网页。控制器层,接收来自客户端的请求,决定哪些业务逻辑需要的地方,下一站去哪里。在Struts框架中,模型用业务逻辑的Java类。 JSP和Taglib是Struts的视图可以实现。该控制器是被称为Servlet的J2EE组件,更具体一个ActionServlet的对象,这就决定什么逻辑被执行时,应该得到控制。图1.Struts结构2 基于ORM的Hibernate框架Java数据库连接(JDBC),面向对象的软件和关系数据库的工作是一项复杂的任务,因为数据是如何表示的对象

33、与关系数据库之间存在不匹配。因此,使用JDBC,开发人员必须写纯结构化查询语言开发(SQL)语句对象模型的映射数据表示关系数据模型及其相应的数据库架构。2.1 Hibernate介绍Hibernate是一个灵活和强大的对象-关系映射(ORM)的解决方案,Java类映射到数据库表。这是一个强大的,高性能的对象关系持久性和查询服务。Hibernate允许开发人员在其自己的便携式SQL扩展来表达查询(Hibernate查询语言(HQL),以及在本地的SQL,或面向对象的标准和示例应用程序编程接口(API)。Hibernate自身需要照顾这个映射使用XML文件,以便开发人员不需要编写代码。Hibern

34、ate是一个开放源代码和用于开发和生产部署,这是一个桥梁Java应用程序关系数据库之间和负责的Java对象和关系数据之间的映射,它是免费的。里面的Hibernate包JDBC,它提供了面向对象的数据库访问到上层应用的API访问数据库的操作。因此,开发人员可以使用对象编程思想,充分操作数据如图2所示,休眠在于中间层和应用程序之间提供了持续的服务,Hibernate的映射类类的属性和映射文件(mapping.xml中)本身的数据表行database。应用程序与数据库由持久化对象(PO)直接处理数据。库,关怀不必要底层数据库结构。Hibernate的减轻了开发人员常见的数据持久化相关的编程任务的95

35、,比手动编码的SQL和JDBC API。它可以集成各种Web服务器或应用服务器,几乎支持所有流行的数据库服务器。2.2 Hibernate标准图2.Hibernate系统结构如图2所示,休眠在于中间层和应用程序之间提供了持续的服务,Hibernate的映射类属性和映射文件(mapping.xml中)本身的数据表行database。应用程序与数据库由持久化对象(PO)直接处理数据。3 Struts和Hibernate的整合在开源框架,用于演示的一部分,代理路由算法具有强大能自然的和网页结合,其文件是太概念性受益编程的。其学习曲线太陡等。Spring的逻辑部分,具有良好的整合功能,但是缺乏公众控制

36、器。和EJB 依赖于EJB容器,在同一时间,实现复杂。虽然Struts已经被广泛应用,因为它的优势。目前,大多数的系统关系数据库应用为主,而Java是一种面向对象的语言本质。在Struts框架的应用程序,使用SQL和JDBC来操作数据库存储和获取对象的模型的一部分,降低了编程的效率和保持了基于EJB的系统性,基于J2EE的应用程序适用于重量级大型企业的发展,同时开发和调试由EJB容器需要消耗大量的时间和高昂的价格。 EJB3提高原始EJB的缺点,但其应用还不够成熟。Hibernate可以替代容器管理持久性(CMP)来完成持久的重任,在J2EE架构中应用EJB 。总之,Hibernate可以解决

37、使用传统的CMP,JDBC和数据访问对象(DAO)在科技的发展的困难时候。为了减少代码的耦合,提高系统的开发效率,本文提出了基于Struts和Hibernate的J2EE应用程序的开发策略。Struts的设计充分显示了MVC的框架,所有的控制流量需要一个配置文件(struts-config.xml中)来管理,这是维护方便。 Struts和Hibernate的集成Hibernate的解决了模型层,Struts中,这使得开发Java对象,而不是数据库。整合显示了面向对象的思想,充分解决了一些问题,在传统的J2EE以及对数据库的操作。3.1 框架的工作流程请求进程的得到相应的Action,Actio

38、nMapping的请求URL。 ActionForm的包JSP页面,它可以使一个检查数据表的数据,如果它是必要的,此外,发回的ActionErrors视觉的页面,如果有错误和行动,如果它通过验证页面的数据传输。请求进程的行动纲领“执行”的方法转移的方法转移的业务逻辑模块。 Hibernate的数据库和JavaBean实现互动。处理业务逻辑与数据库中的数据持久层和领域对象层交互的操作。“执行”行动的方法,将返回的ActionForward对象的ActionServlet执行后所接受的。3.2整合框架的系统结构在EIS层的多层J2EE系统结构可以被划分为数据持久层7和数据资源层。这意味着,一个系统

39、可以被分为5个层作为一个整体。客户层:该层运行在用户的计算机上的浏览器的用户,传输和显示给用户的消息和处理互动。 J2EE平台支持不同类型的用户,包括HTML用户,Java小程序,Java应用程序等。表示层:此层工作在J2EE的Web容器,生产系统表述逻辑,处理用户的请求,并作出响应。整个网络是建立在Struts框架中,视图组件由JSP / HTML页面的数据所表达的ActionForm Bean的控制器组件是由ActionServlet的团结的Struts-config.xml和动作类,和标准组件实现业务逻辑层。商业逻辑层:这一层实现所需的业务系统,表示层提供所需的业务方法。它可以接收来自客户端程序和妥善处置后,将它们保存到存储设备,数据存储设备读取数据,然后将其发送到客户端程序。这层是由如JavaBean和会话EJB的业务对象(BO)。图3.基于Struts +Hibernate整合后的流程图

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!