节点文献

基于J2EE平台的轻量级框架的应用研究

Research and Application of Lightweight Framework Based on J2EE

【作者】 刘昆

【导师】 冉春玉;

【作者基本信息】 武汉理工大学 , 计算机应用技术, 2008, 硕士

【摘要】 随着Java开源运动的不断发展,从数据持久层到业务逻辑层再到表示层都涌现出一批优秀的轻量级框架,从而极大地推动了J2EE技术的发展。传统的以EJB为核心的J2EE架构由于引入了不必要的复杂性,导致应用程序过于复杂、开发效率低、难于测试、维护成本高。在这种情况下,轻量级框架能够使企业级Web应用实现组件式开发、提高重用性、易于修改和维护、更好地解决项目开发中的开发周期问题以及需求变更问题,从而使企业资源得到最大化的利用,提出更有利于企业提高利润的解决方案。本文探讨了J2EE框架和轻量级框架技术的发展,对轻量级开发的核心机制控制反转和面向方面编程进行了剖析,针对表示层、业务层和持久层的实现提出了基于Struts2+Spring+Hibernate的轻量级解决方案。其中,Struts2是一个致力于组件化和代码重用的拉出式MVC模式实现框架,以其灵活、强大的功能为Web应用的构建减轻了负担。Spring是一个基于IoC的轻量级容器,区别于EJB的强侵入式,Spring的依赖注入动态的使系统各组件间达到松散耦合,并且能和各种框架很好的兼容。Hibernate是一个基于O/R映射的持久层框架,全面减轻了维护数据的复杂度,使系统具有良好的性能和移植性。本文以作者参与的某电视台办公自动化信息系统为背景,在对其进行全面需求分析的基础上,分别对Web层、业务逻辑层、数据持久层进行了详细设计。针对项目特点,在对比了各种框架技术的优势后,整合Struts2、Spring、Hibernate三种框架技术,提出了一个具有通用模式的轻量级架构:Struts2实现MVC模式并完成Web表示层功能,其业务逻辑交由Spring来管理;Spring负责管理表现层控制器与数据访问对象间关系,完成业务逻辑层功能;Hibernate负责数据的持久化工作。综上所述,本文在对各种主流框架技术深入分析的基础上,提出了集成Struts2、Spring、Hibernate三种框架技术的轻量级架构,不但能够有效地解决传统Web应用开发中存在的问题,而且采用分层及模块化设计使系统具有很高的可维护性、扩展性、移植性和组件的复用性。

【Abstract】 Amounts of excellent Lightweight OpenSource frameworks on data persistence layer,business layer and presentation layer emerged with the development of the Java OpenSource movement,which greatly promoted the technology of J2EE.The traditional J2EE framework whose core point is EJB introduce certain unnecessary complexity,which result in the programs excessively complex,low efficiency of developing,testing difficultly and high cost of maintenance.In this situation, lightweight frameworks can help company to realize component development, increase reuse,be easy to modify and maintenance,it can also resolve the question of development cycle and requirement changing in the development better,maximize the utilization rate of the resource of enterprises,and put in resolvable plan which is favorable to increase the interests of the company.This paper inquiried into the J2EE and the lightweight framework at first,then analyses to the core technology of lightweight development AOP and Ioc.This text mainly put forward a lightweight solution by integrating Struts2,Spring and Hibernate,aiming at the realization of web layer,business logic layer and data persistence layer.Strnts2 is a pull-out framework of implementing MVC pattern and strives for reusing module and code,it relieves burden for constructing Web application by its flexible and powerful function.Differentiating strong invasion of EJB,Spring which is a lightweight container based inversion of control is designed with dependency injection and can make component loose coupling dynamically and compatible with other framework.Hibernate is a persistence framework based on object-relation mapping;which entirely reduces the complexity of maintaining data and make system have higher performance and portable.This paper takes the project of office automation system of a television station as example.To detailed design for each layer such as web layer,business logic layer and data persistence layer based on requirements analysis completely.As for the characteristic of project,after compared advantages of all sorts of framework technologies,the author integrated with Struts2,Spring and Hibernate and put forward a general model of lightweight architecture,what is that Struts2 which implemented MVC pattern play the role of Web presentation layer and hand over its business logic to Spring,manage objects’ relation of between controller and data access object through Spring and make data persistence by Hibernate.In conclusion,this thesis made did deep analysis of many popular frameworks and offer a lightweight architecture of integrating Sruts2,Spring and Hibernate, which not only resolve traditional issues in Web design but also enhance the system’s maintainability,expansibility,compatibility and reusability through adopting delamination and modularization.

【关键词】 J2EE轻量级IoCO/R映射
【Key words】 J2EELightweightIoCORM
  • 【分类号】TP311.52
  • 【被引频次】21
  • 【下载频次】192
节点文献中: 

本文链接的文献网络图示:

本文的引文网络