资源描述
学校代码: 10128
学 号:
本科毕业设计外文文献翻译 翻译翻译
二 〇 一 五 年 一 月
内蒙古工业大学本科毕业设计外文文献翻译
The Test Library Management System of Framework Based on SSH
The application system features in small or medium-sized enterprise lie in the greater flexibility and safety high performance-price ratio. Traditional J2EE framework can not adapt to these needs, but the system application based on SSH(Struts+Spring+Hibernate) technology can better satisfy such needs. This paper analyses some integration theory and key technologies about SSH, and according to the integration constructs a lightweight WEB framework, which has integrated the three kinds of technology ,forming the lightweight WEB framework based on SSH and gaining good effects in practical applications.
Introduction
Generally the J2EE platform[27] used in large enterprise applications, can well solve the application of reliability, safety and stability, but its weakness is the price high and the constructing cycle is long. Corresponding to the small or medium enterprise applications, the replace approach is the system framework of lightweight WEB, including the more commonly used methods which are based on the Struts and Hibernate. With the wide application of Spring, the three technology combination may be a better choice as a lightweight WEB framework. 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. This framework can solve a lot of problems, with good maintainability and scalability. It can solve the separation of user interface and business logic separation, the separation of business logic and database operation and the correct procedure control logic, etc. This paper studies the technology and principle of Struts and Spring and Hibernate, presenting a proved lightweight WEB application framework for enterprise.
Hierarchical Web Mechanism
Hierarchical Web framework including the user presentation layer, business logiclayer, data persistence layer ,expansion layer etc, each layer for different function, respectively to finish the whole application. The whole system are divided into different logic module with relatively independent and mutual, and each module can be implemented according to different design. It can realize the system parallel development, rapid integration, good maintainability, scalability.
Struts MVC Framework
To ensure the reuse and efficiency of development process, adopting J2EE technology to build the Web application must select a system framework which has a good performance . Only in this way can we ensure not wasting lots of time because of adjusting configuration and achieve application development efficiently and quickly. So, programmers in the course of practice got some successful development pattern which proved practical, such as MVC and O/R mapping, etc; many technologies, including Struts and Hibernate frameworks, realized these pattern. However, Struts framework only settled the separation problem between view layer and business logic layer, control layer, did not provide a flexible support for complex data saving process. On the contrary, Hibernate framework offered the powerful and flexible support for complex data saving process. Therefore, how to integrate two frameworks and get a flexible, low-coupling solutions project which is easy to maintain for information system, is a research task which the engineering staff is studying constantly.
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 is a typical MVC frame[32], 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 ActionServlet, 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.
Spring Framework technology
Spring 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 Spring AOP module.
Hibernate Persistent Framework
Hibernate is a kind of open source framework with DAO design patterns to achieve mapping(O/R Mapping) between object and relational database.
During the Web system development, the tradition approach directly interacts with the database by JDBC .However, this method has not only heavy workload but also complex SQL codes of JDBC which need to revise because the business logic slightly changes. So, whatever development or maintain system are inconvenient. Considering the large difference between the object-oriented relation of java and the structure of relational database, it is necessary to introduce a direct mapping mechanism between the object and database, which this kind of mapping should use configuration files as soon as possibility, so that mapping files will need modifying rather than java source codes when the business logic changes in the future. Therefore, O/R mapping pattern emerges, which hibernate is one of the most outstanding realization of architecture.
It encapsulates JDBC with lightweight , making Java programmer operate a relational database with the object oriented programming thinking. It is a a implementation technology in the lasting layer. Compared to other lasting layer technology such as JDBC, EJB, JDO, Hibernate is easy to grasp and more in line with the object-oriented programming thinking. Hibernate own a query language (HQL), which is fully object-oriented. The basic structure in its application as shown in figure6.1.
Hibernate is a data persistence framework, and the core technology is the object / relational database mapping(ORM). Hibernate is generally considered as a bridge between Java applications and the relational database, owing to providing durable data services for applications and allowing developers to use an object-oriented approach to the management and manipulation of relational database. Furthermore, it furnishes an object-oriented query language-HQL.
Responsible for the mapping between the major categories of Java and the relational database, Hibernate is essentially a middle ware providing database services. It supplies durable data services for applications by utilizing databases and several profiles, such as hibernate properties and XML Mapping etc..
Web services technologies
The introduction of annotations into Java EE 5 makes it simple to create sophisticated Web service endpoints and clients with less code and a shorter learning curve than was possible with earlier Java EE versions. Annotations — first introduced in Java SE 5 — are modifiers you can add to your code as metadata. They don't affect program semantics directly, but the compiler, development tools, and runtime libraries can process them to produce additional Java language source files, XML documents, or other artifacts and behavior that augment the code containing the annotations (see Resources). Later in the article, you'll see how you can easily turn a regular Java class into a Web service by adding simple annotations.
Web application technologies
Java EE 5 welcomes two major pieces of front-end technology — JSF and JSTL — into the specification to join the existing JavaServer Pages and Servlet specifications. JSF is a set of APIs that enable a component-based approach to user-interface development. JSTL is a set of tag libraries that support embedding procedural logic, access to JavaBeans, SQL commands, localized formatting instructions, and XML processing in JSPs. The most recent releases of JSF, JSTL, and JSP support a unified expression language (EL) that allows these technologies to integrate more easily (see Resources).
The cornerstone of Web services support in Java EE 5 is JAX-WS 2.0, which is a follow-on to JAX-RPC 1.1. Both of these technologies let you create RESTful and SOAP-based Web services without dealing directly with the tedium of XML processing and data binding inherent to Web services. Developers are free to continue using JAX-RPC (which is still required of Java EE 5 containers), but migrating to JAX-WS is strongly recommended. Newcomers to Java Web services might as well skip JAX-RPC and head right for JAX-WS. That said, it's good to know that both of them support SOAP 1.1 over HTTP 1.1 and so are fully compatible: a JAX-WS Web services client can access a JAX-RPC Web services endpoint, and vice versa.
The advantages of JAX-WS over JAX-RPC are compelling. JAX-WS:
· Supports the SOAP 1.2 standard (in addition to SOAP 1.1).
· Supports XML over HTTP. You can bypass SOAP if you wish. (See the article "Use XML directly over HTTP for Web services (where appropriate)" for more information.)
· Uses the Java Architecture for XML Binding (JAXB) for its data-mapping model. JAXB has complete support for XML schema and better performance (more on that in a moment).
· Introduces a dynamic programming model for both server and client. The client model supports both a message-oriented and an asynchronous approach.
· Supports Message Transmission Optimization Mechanism (MTOM), a W3C recommendation for optimizing the transmission and format of a SOAP message.
· Upgrades Web services interoperability (WS-I) support. (It supports Basic Profile 1.1; JAX-WS supports only Basic Profile 1.0.)
· Upgrades SOAP attachment support. (It uses the SOAP with Attachments API for Java [SAAJ] 1.3; JAX-WS supports only SAAJ 1.2.)
· You can learn more about the differences by reading the article "JAX-RPC versus JAX-WS."
The wsimport tool in JAX-WS automatically handles many of the mundane details of Web service development and integrates easily into a build processes in a cross-platform manner, freeing you to focus on the application logic that implements or uses a service. It generates artifacts such as services, service endpoint interfaces (SEIs), asynchronous response code, exceptions based on WSDL faults, and Java classes bound to schema types by JAXB.
JAX-WS also enables high-performing Web services. See Resources for a link to an article ("Implementing High Performance Web Services Using JAX-WS 2.0") presenting a benchmark study of equivalent Web service implementations based on the new JAX-WS stack (which uses two other Web services features in Java EE 5 — JAXB and StAX) and a JAX-RPC stack available in J2EE 1.4. The study found 40% to 1000% performance increases with JAX-WS in various functional areas under different loads.
Conclusion
Each framework has its advantages and disadvantages .Lightweight J2EE structure integrates Struts and Hibernate and Spring technology, making full use the powerful data processing function of Struts and the management flexible of Spring and the mature of Hibernate. According to the practice, putting forward an open-source solutions suitable for small or medium-sized enterprise application of. The application system based on this architecture technology development has interlayer loose coupling ,structure distinctly, short development cycle, maintainability. In addition, combined with commercial project development, the solution has achieved good effect. The lightweight framework makes the parallel development and maintenance for commercial system convenience, and can push forward become other industry business system development.
Through research and practice, we can easily find that Struts / Spring / Hibernate framework utilizes Struts maturity in the presentation layer, flexibility of Spring business management and convenience of Hibernate in the serialization layer, three kinds of framework integrated into a whole so that the development and maintenance became more convenient and handy. This kind of approach also will play a key role if applying other business system. Of course ,how to optimize system performance, enhance the user's access speed, improve security ability of system framework ,all of these works, are need to do for author in the further.
基于SSH框架实现的试题库管理系统
小型或者中型企业的应用系统具有非常好的灵活性、安全性以及高性价比,传统的J2EE架构满足不了这些需求,但是基于SSH框架实现的应用系统更好的满足了这样的需求,这篇文章分析了关于SSH的一体化理论和关键技术,通过这些集成形成了轻量级Web框架,在已经集成三种技术的基础上,伴随形成了基于SSH的轻量级Web 框架,并且在实际应用中有着重要作用。
简介
一般大型企业使用的是J2EE[27]平台,很好的解决了该应用的可靠性、安全性、稳定性,它的缺点是费用高、形成该系统的周期长,对于小型或者中型企业级应用,可以用轻量级Web代替系统框架,比如通用的Struts和Hibernate,随着Spring的广泛应用,轻量级Web框架开发的最好选择是Struts、Hibernate、Spring三者的相结合,因为它采用的是分层结构并且为Web应用程序在各层提供了一个框架的集成,这样不仅降低了层与层之间的耦合性,而且提高了开发效率。使用该框架可已经解决好多问题,具有可维护性和可扩展性,使得用户接口和业务逻辑层之间分离,业务逻辑层、数据库访问层、以及程序控制层的分离等。本文研究了Struts、Hibernate以及Spring的技术和使用原则,呈现出企业级轻量级Web应用框架开发的权威性。
网络分层机制
网络分层主要分为:视图层、控制层、数据库持久层、拓展层等,使用每一层不同的功能完成整个应用程序。整个系统划分成相互独立、相互依存的不同逻辑 模块,根据具体设计调用不同的逻辑模块实现逐步实现该系统。同时实现系统并行开发、快速集成、可维护性、可扩展性。
Struts MVC 框架
为了确保高效率再次使用发展过程,采用J2EE技术去构建Web应用程序不许选择一个具有良好性能的框架,这使得我们没有花费大量时间去进行系统配置,而是去高效率、快速地实现系统开发,因此程序员拥有很好的发展平台并且开发经验有了提升,如:MVC、O/R映射等。运用包括Struts、Hibernate这些技术框架实现这种模式。然而,Struts解决的是视图层、业务逻辑层、控制层之间的分离,对于那些错综复杂的数据保存没有提供灵活的支持。相反,Hibernate框架提供了强大且灵活的支持在保存错综复杂的数据时。因此工程人员正在研究使用框架并且灵活开发项目。
模型-视图-控制器,所谓的MVC是一种流行的设计模式。它把交互式系统中三种组成成分有一个明确的分工,各自负责自己的任务,MVC模型包含程序数据并且管理核心功能。模型和反馈给用户的可视化显示由视图层管理,控制层要负责解释来自用户的输入,属于主导地位,也会通过对控制层的操作来改变视图层。MVC从系统页面的分离来提高系统的可扩展性和可维护性。Struts是典型的MVC框架,并且包含上述三层。模型级别由JavaBean和EJB
展开阅读全文