网上商城系统毕业设计外文翻译.doc

上传人:laozhun 文档编号:2325935 上传时间:2023-02-11 格式:DOC 页数:11 大小:112KB
返回 下载 相关 举报
网上商城系统毕业设计外文翻译.doc_第1页
第1页 / 共11页
网上商城系统毕业设计外文翻译.doc_第2页
第2页 / 共11页
网上商城系统毕业设计外文翻译.doc_第3页
第3页 / 共11页
网上商城系统毕业设计外文翻译.doc_第4页
第4页 / 共11页
网上商城系统毕业设计外文翻译.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《网上商城系统毕业设计外文翻译.doc》由会员分享,可在线阅读,更多相关《网上商城系统毕业设计外文翻译.doc(11页珍藏版)》请在三一办公上搜索。

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

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

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

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

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

6、xchanges 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 J

7、ava 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.2 Hibernate

8、Framework Based on ORM Working 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

9、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 Hibernate Hibernate is a flexible and powerful Object-Relational Mapping (ORM) solution to map Java classes to database table

10、s. 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

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

12、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 sufficient

13、ly, 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 a

14、ll popular databases server.2.2 Principle of Hibernate As shown in figure , 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. Applic

15、ation interacts with database by Persitstent Object (PO) to handle data directly.Figure 2.1 Hibernate systematic structure3 The Integration of Struts and Hibernate In the open source frameworks, for the presentation part, Tapestry has the powerful and natural combination of pages, its document is to

16、o 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 ap

17、plied 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 progr

18、amming 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 dis

19、advantages 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

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

21、rol 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-orient

22、ed thought sufficiently and solves some problems of the database operation in traditional J2EE well.3.1 Flow of Framework The 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 ActionServ

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

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

25、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 Framework The EIS layer of the multi-layer J2EE systematic structure can be p

26、artitioned 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 differ

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

28、 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 busines

29、s 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.1 基于MVC的Struts框架 在传统的Web应用程序,Java服务器页面(JSP

30、)页面负责处理所有的事情,例如,接收请求,执行业务逻辑,选择下一个页面。这些复杂的事情,可能会导致混乱JSP 页面编码和有害的扩展和维护的JSP页面。模型-视图-控制器(MVC)模式编程代码分离成三个不同的区域,它已经解决了上述问题。 MVC可以实现J2EE应用程序的系统的分层和三层或多层的松散耦合,它是一个实现的定向动态内容的方式。 MVC模式把应用程序分成三个核心部件的模型,视图和控制器。Struts是一个MVC实现。它是一个开源Web应用框架,使用Servlet和JSP标记属于J2EE规范的一部分实现。的Struts继承了MVC的特点和根据J2EE性状,实现一些相应的变化和扩展。 Str

31、uts的分离JSP的Java代码的Java Bean和Action类是MVC模式,数据传输三者间的分区模型,视图和控制器,演示各种类和JSP页面之间的连接配置文件,终于和它打算实现表现层,业务层和数据层的分离。 Struts的结构示于图1。该模型包含业务逻辑交换数据持久层。查看是负责生产的,什么是直接对用户可见,例如网页。控制器层,接收来自客户端的请求,决定哪些业务逻辑需要的地方,下一站去哪里。在Struts框架中,模型用业务逻辑的Java类。 JSP和Taglib是Struts的视图可以实现。该控制器是被称为Servlet的J2EE组件,更具体一个ActionServlet的对象,这就决定什

32、么逻辑被执行时,应该得到控制。2 基于ORM的Hibernate框架 Java数据库连接(JDBC),面向对象的软件和关系数据库的工作是一项复杂的任务,因为数据是如何表示的对象与关系数据库之间存在不匹配。因此,使用JDBC,开发人员必须写纯结构化查询语言开发(SQL)语句对象模型的映射数据表示关系数据模型及其相应的数据库架构。2.1 Hibernate介绍 Hibernate是一个灵活和强大的对象-关系映射(ORM)的解决方案,Java类映射到数据库表。这是一个强大的,高性能的对象关系持久性和查询服务。Hibernate允许开发人员在其自己的便携式SQL扩展来表达查询(Hibernate查询语

33、言(HQL),以及在本地的SQL,或面向对象的标准和示例应用程序编程接口(API)。Hibernate自身需要照顾这个映射使用XML文件,以便开发人员不需要编写代码。 Hibernate是一个开放源代码和用于开发和生产部署,这是一个桥梁Java应用程序关系数据库之间和负责的Java对象和关系数据之间的映射,它是免费的。里面的Hibernate包JDBC,它提供了面向对象的数据库访问到上层应用的API访问数据库的操作。因此,开发人员可以使用对象编程思想,充分操作数据如图2所示,休眠在于中间层和应用程序之间提供了持续的服务,Hibernate的映射类类的属性和映射文件(mapping.xml中)本

34、身的数据表行database。应用程序与数据库由持久化对象(PO)直接处理数据。库,关怀不必要底层数据库结构。 Hibernate的减轻了开发人员常见的数据持久化相关的编程任务的95,比手动编码的SQL和JDBC API。它可以集成各种Web服务器或应用服务器,几乎支持所有流行的数据库服务器。2.2 Hibernate标准 如图所示,休眠在于中间层和应用程序之间提供了持续的服务,Hibernate的映射类属性和映射文件(mapping.xml中)本身的数据表行database。应用程序与数据库由持久化对象(PO)直接处理数据。图2.1 Hibernate系统结构3 Struts和Hiberna

35、te的整合 在开源框架,用于演示的一部分,代理路由算法具有强大能自然的和网页结合,其文件是太概念性受益编程的。其学习曲线太陡等。Spring的逻辑部分,具有良好的整合功能,但是缺乏公众控制器。和EJB 依赖于EJB容器,在同一时间,实现复杂。虽然Struts已经被广泛应用,因为它的优势。 目前,大多数的系统关系数据库应用为主,而Java是一种面向对象的语言本质。在Struts框架的应用程序,使用SQL和JDBC来操作数据库存储和获取对象的模型的一部分,降低了编程的效率和保持了基于EJB的系统性,基于J2EE的应用程序适用于重量级大型企业的发展,同时开发和调试由EJB容器需要消耗大量的时间和高昂

36、的价格。 EJB3提高原始EJB的缺点,但其应用还不够成熟。 Hibernate可以替代容器管理持久性(CMP)来完成持久的重任,在J2EE架构中应用EJB 。总之,Hibernate可以解决使用传统的CMP,JDBC和数据访问对象(DAO)在科技的发展的困难时候。为了减少代码的耦合,提高系统的开发效率,本文提出了基于Struts和Hibernate的J2EE应用程序的开发策略。 Struts的设计充分显示了MVC的框架,所有的控制流量需要一个配置文件(struts-config.xml中)来管理,这是维护方便。 Struts和Hibernate的集成Hibernate的解决了模型层,Stru

37、ts中,这使得开发Java对象,而不是数据库。整合显示了面向对象的思想,充分解决了一些问题,在传统的J2EE以及对数据库的操作。3.1 框架的工作流程 请求进程的得到相应的Action,ActionMapping的请求URL。 ActionForm的包JSP页面,它可以使一个检查数据表的数据,如果它是必要的,此外,发回的ActionErrors视觉的页面,如果有错误和行动,如果它通过验证页面的数据传输。 请求进程的行动纲领“执行”的方法转移的方法转移的业务逻辑模块。 Hibernate的数据库和JavaBean实现互动。处理业务逻辑与数据库中的数据持久层和领域对象层交互的操作。“执行”行动的方

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

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

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号