研究基于SSH的Web应用程序框架外文翻译资料

 2022-07-25 13:59:26

2008 International Seminar on Business and Information Management

The Research of Web Application Framework Based on SSH

Fang Liu, Hongxia Guo

School of Computer Science and Technology

Wuhan University of Technology

Wuhan, China lfhust@gmail.com

Bo Fu

School of Electrical and Electronic Engineering

Hubei University of Technology

Wuhan, China

Abstract—Based on the three popular open sources as Struts, Spring and Hibernate (SSH), an integrated framework for e-human resource (E-HR) is proposed in this paper as an effective web application framework. E-HR is generally regarded as a complicated enterprise information system and the proper application framework is supposed to improve the system expansibility and the enterprise competitiveness as well. The presented framework derives from model-driven approach with high usage of code generation tools and application layout templates. Result shows that in the construction of business system, Struts and Spring and Hibernate architecture can improve the efficiency of system development and strengthen the extensibility and maintainability of the system. It not only separates the presentation layer, business layer and data persistence layer, but also provides a convenient platform for software reuse. Furthermore, it allows for speeding-up development of web applications. By comprehensively analyzing the distinct characteristics of the framework such as scalability, maintainability and less coupling complexity, the specific application of the framework in the file management module of the E-HR system is carried out to further shows the advantages of SSH in software development efficiency.

Keywords--Web Application Framework; Struts; Spring ;Hibernate; E-HR

I. INTRODUCTION

The web application project has been receiving great attention in recent years and becomes more pervasive, while the complexity of developing a web application system grows rapidly. Consequently, adopting an accurate, economical and efficient method for web application is more urgent than ever. SSH (Struts, Spring and Hibernate) is expected to be a good framework for solving problems mentioned above. System based on SSH(Struts, Spring and Hibernate) architecture has the features as low coupling, high reusability and expansibility, high maintainability and so on. It uses layered structure and provides a good integrated framework for Web applications at all levels in minimizing the Interlayer coupling and increasing the efficiency of development. Compared with the traditional human resource scheme, the e-human resource (E-HR) supplies more advanced techniques in daily transaction management, administrative management and appreciation service. Faced with such large-scale web application, the conventional framework is buffered for the complex presentation and logical processing.

In this paper, the research of web application framework based on SSH is brought forward and applied to construct an e-HR system. The basic theory of SSH framework is introduced in Section II. In Section III , the structure of SSH for E-HR is explained in detail. Results from the application analysis are reported. Finally, conclusions are obtained in Section IV.

II. STRUTS SPRING HIBERNATE FRAMEWORK

A. The Characteristics of Struts, Spring and Hibernate

Model-View-Controller (MVC) is a popular design pattern. It divides the interactive system in three components and each of them specializes in one task. The model contains the application data and manages the core functionality. The visual display of the model and the feedback to the users are managed by the view. The controller not only interprets the inputs from the user, but also dominates the model and the view to change appropriately. MVC separates the system functionality from the system interface so as to enhance the system scalability and maintainability.

Struts [1] is a typical MVC frame, and it also contains the three aforementioned components. The model level is composed of JavaBean and EJB components. The controller is realized by action and Action Servlet, and the view layer consists of JSP files. The central controller controls the action execution that receives a request and redirects this request to the appropriate module controller. Subsequently, the module controller processes the request and returns results to the central controller using a JavaBean object, which stores any object to be presented in the view layer by including an indication to module views that must be presented. The central controller redirects the returned JavaBean object to the main view that displays its information. Fig. 1 describes the Struts frame structure.

Struts focuses on reducing the coupling between performance and logic, while takes less attention to the relevance between business layer and persistence layer.

Figure 1. Struts frame structure.

Spring [2] is a lightweight J2EE application development framework, which uses the model of Inversion of Control (IOC) to separate the actual application from the Configuration and dependent regulations of the application. Committed to J2EE application at all levels of the solution, Spring is not attempting to replace the existing framework, but rather “welding” the object of J2EE application at all levels together through the POJO management. In addition, developers are free to choose Spring framework for some or all, since Spring modules are not totally dependent.

As a major business-level detail, Spring employs the idea of delay injection to assemble code for the sake of improving the scalability and flexibility of built systems. Thus, the systems achieve a centralized business processing and reduction of code reuse through the Spr

全文共20331字,剩余内容已隐藏,支付完成后下载完整资料


国际研讨会业务和信息管理

研究基于SSH的Web应用程序框架

刘方,郭红霞

计算机科学与技术学院 武汉科技大学

武汉,中国lfhust@gmail.com

傅博

电气和电子工程学院

湖北科技大学

武汉,中国

摘要:

基于三种流行的开放来源Struts、Spring和Hibernate(SSH), 对人力资源的一个集成框架(e-HR)是本文提出了作为一个有效的web应用程序框架。E-HR通常被认为是一个复杂的企业信息系统和适当的应用程序框架,目的是提高系统的扩展性和企业竞争力。所提出的框架源于模型驱动的方法,它使用代码生成工具和应用程序布局模板。结果表明,在业务系统,Struts和Spring和建设的Hibernate架构可以提高系统的开发效率,增强系统的可扩展性和可维护性。它不仅分离表示层,业务层和数据持久层,但也为软件重用提供了一个方便的平台。此外,它还允许web应用程序加快发展。通过全面分析框架的不同的特征,如可伸缩性、可维护性和耦合的复杂性, 在e-HR系统的框架的特定应用程序的文件管理模块进行进一步显示了SSH在软件开发效率的优点。

关键词——Web应用程序框架、Struts、Spring、Hibernate、E-HR

1介绍

虽然web应用程序项目近年来得到高度重视,同时变得越来越普遍,但是开发一个web应用程序系统的复杂性也迅速增长。因此,采用准确、经济和有效的方法对web应用程序来说比以往任何时候都更为紧迫。SSH(Struts、Spring和Hibernate)预计将是一个很好的框架来解决上面提到的问题。基于SSH系统(Struts的 Spring Hibernate的)架构所具有的功能为低耦合,高可重用性和可扩展性,可维护性休等。它使用分层结构,为Web应用程序提供了一个良好的集成框架,各级之间减少层间耦合,提高开发的效率。相比与传统的人力资源计划,e-human资源(E-HR)给日常事务管理、行政管理和增值服务提供了更先进的技术。面对如此大规模的web应用程序,复杂的传统框架以缓冲应付复杂的演示和逻辑处理。

本文研究基于SSH的web应用程序框架的提出和应用构建一个e-HR系统。介绍了SSH框架的基本理论部分。在第三节,给出了SSH的结构E-HR详细解释。结果从应用程序分析报告。最后,结论是在第四节获得的。

2 STRUTS SPRING HIBERNATE框架

a Struts、Spring和Hibernate的特征

模型-视图-控制器(MVC)是一种流行的设计模式。它分三个组件的交互系统,他们每个人专门从事一项任务。模型包含应用程序的数据和管理核心功能。模型的视觉显示和反馈到用户管理的视图。控制器不仅解释用户的输入,而且还占据了适当地改变模型和视图。MVC分离系统接口的系统功能,提高系统的可扩展性和可维护性。

Struts[1]是一个典型的MVC框架,同时它还包含三个提到的组件。模型层级由JavaBean和EJB组件。由行动和Action Servlet控制器实现,视图层由JSP文件实现。中央控制器控制动作的执行接收请求并将请求重定向到适当的模块控制器。随后,该模块控制器处理请求并将结果返回给中央控制器,使用JavaBean对象存储任何对象在视图层包括显示模块视图必须呈现出。中央控制器重定向返回的Java Bean对象来显示其信息的主要观点。图1描述了Struts框架结构。

Struts的重点是减少性能和逻辑之间的耦合,同时占用较少关注在业务层和持久层之间的相关性上

Event

Business Logic

Action

Controller

Servlet

HTTP Request

Structs-config.xml

Client Browse

Client browse event http

Client browse event http

Invoke

Forward

Update

Get

View

JSP

Model

Application

HTTP Response lt;Taggt;

图1所示 Struts框架结构。

spring[2]是一个轻量级J2EE应用程序开发框架,它使用控制反转(IOC)模型来分离实际应用配置同时遵循应用程序的相关规定。致力于各级J2EE应用程序的解决方案,spring不是试图取代现有的框架,而是“焊接”各级J2EE应用程序的对象通过POJO一起管理。此外,开发人员可以自由选择部分或全部Spring框架,因为Spring模块不完全依赖于什么。

作为主要业务级别的细节,Spring为了提高构建系统的可伸缩性和灵活性使用延迟的想法注入组装代码。因此,系统能实现集中业务处理和减少通过Spring AOP的模块代码重用。

Hibernate[3]是一个数据持久性框架,核心技术是数据库对象/关系映射(ORM)。Hibernate通常被认为是作为一个Java应用程序和关系数据库之间的桥梁,由于提供持久的数据应用程序和服务,允许开发者使用面向对象关系数据库的管理和操作方法。此外,它提供了一个面向对象的查询语言HQL,这样方便操作执行的一个类的对象,示例和属性。

由于负责的主要类别之间的映射Java和关系数据库,Hibernate本质上是一个中间件提供数据库服务。它提供持久的数据服务应用程序利用数据库和一些资料,如hibernate属性和XML映射等。

b . SSH框架的结构

SSH架构分为三层:表示层,业务层和持久层,如图1所示。每一层的功能非常明确,各层之间通过特定的接口进行通信。

Struts框架在表示层使用。 Struts框架的核心是一个MVC(模型 - 视图 - 控制器)式控制器,它负责了MVC,它可以退去体系结构的耦合。 Hibernate框架用于支持持久层,可以降低经营模式发展的难度。 Spring框架是用来处理与业务层的复杂业务。与此架构开发的Web系统将具有较低的耦合不仅在整个体系结构,而且在部分复杂的商业模式,其灵活性和可维护性也能够提高。这种架构可以克服发展中单独使用这些框架体系的不足。

本文的开发集成框架通过组合这三个框架的特征和Web应用的分层想法,这降低了系统的每一层的耦合度,并具有该系统更容易提供各级的Web应用程序的适当集成策略用于维护和扩展。

1)表示层(界面层)主要是通过Struts。这个过程被描述为,在通过Action Servlet Struts截获用户请求开始,处理请求,然后调用模型根据需求,最后通过JSP文件结果显示给用户。系统方便地保持在这种机制通过将数据处理和显示。同时,副控制器是由Struts上层业务逻辑及其他治疗方法。此外,通过commons-validator.jar组合,强大的数据检查功能是提供给UI检查表示层。。

2)Spring框架是用来实现业务层中每一个层次的细节。通过使用interface-oriented编程,弹簧工厂模型提供了Bean生成和管理,避免了复杂的编译和Bean以硬编码的形式之间的问题的方法。spring[4]采用的模型控制反转(IOC)管理事务层之间

因此对象的实现变得透明,组件之间的耦合业务减少,系统的兼容性和可扩展性得到明显改善。为实现各级无缝连接的web应用程序中,Spring支持管理POJO,此外,它还控制的实现过程从表示层到持久层和层间相互作用提供了接口。

3)持久层是由Hibernate框架[5]。通过O / R映射, 数据库对象映射成相应的Hibernate持久化类和这些类是中间层有用[6]。数据库操作是由DAO模式,数据库操作和业务逻辑分离。Hibernate提供了一个java持久化机制和查询服务[7]。该方法通过翻译的Java类HQL语句到SQL语句 然后完成与JDBC驱动程序的数据操作,大大降低了持久性数据编程任务的发展。

4)Struts和Spring的整合

当我们整合这两个框架Struts动作将被委托给spring。具体来说,在Struts配置文件struts-config.xml中,我们使用类

由Spring提供Delegating Action Proxy作为type属性,Delegating Action Proxy从类org.apache.struts.action.Action的扩展的类,它发送请求到实际行动。以这种方式,由支柱在运行时加载的类实际上是Delegating Action Proxy其中实现了真正的动作的代理,使得由支柱称为动作实例将被Spring最后进行管理。

5) Hibernate和Spring集成

Hibernate中最重要的配置文件是hibernate.cfg.xml中。所需的类是持久和相关的全局属性在此文件中定义。当这两个框架集成,Hibernate会被Spring管理。前者hibernate.cfg.xml文件的内容也由Spring管理。spring使用类的Local Session Factory Bean实现休眠的封装和接口转换。这样我们就可以使用统一的方式来处理Spring和Hibernate。在Hibernate中的应用,该Spring类的Hibernate Template能完成的工作为捕获异常,管理事务等,没有任何多余的代码。

6)这三个框架的整合

完成4)和5)的两个步骤后,再jar包复制到类路径中,我们将完成以下三个框架的整合

3 E-HR SSH框架的结构

电子人力资源(信息系统E-human资源)通过网络为特殊客户提供相关服务。作为一个大型web应用程序项目,E-HR系统是由不同的模块组成的。由于复杂的模块关系,本文关注了员工信息管理模块描述SSH E-HR系统上的web应用程序。

图2是E-HR提出的结构系统。这表明采用JSP作为表示层,收集用户请求数据和业务数据,网络层利用MVC框架来控制之间的交互业务层和表示层,业务层和业务逻辑组件主要是通过Spring IOC容器业务逻辑组件来掌握。DAO层由各种刀组件、控制数据库访问数据库对象和持久性对象之间的交互构成。Hibernate持久性层由许多PO文件组成,实现数据库访问在Hibernate会话管理。结构展品Spring框架是系统的核心,和MVC控制,服务水平的组件和刀组件是由Spring IOC容器,都是管理组件的实例。

提到E-HR系统中的员工信息管理模块,包括员工基本信息、家庭信息、合同信息等。系统将提供基本操作上提到的信息。从Web-level的角度, 表示层只提供功能来显示数据,中间层是负责与用户的请求在显示层处理和更新数据,以及数据库层存储的信息。中间层是详细描述如下。

JSP files(view)

Display、update client data

Web layer(controller)

Interaction control between business layer and presentation layer

EmpManagerImpl .class

Implement class

EmpManager .class

Interface class

Service layer

Encapsulation of business logic method

Providing interface for web layer

EmployeeDaoHibernate.class

FamilyDaoHibernate.class

Implement class for DAO interface

EmployeeDao.class

FamilyDao.class

DAO interface files

DAO layer

Encapsuation of data base operations

Employee.hbm.xml

Family.hbm.xml

Mapping.files

Employee.class

lt;

全文共7546字,剩余内容已隐藏,支付完成后下载完整资料


资料编号:[154873],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。