轻量级J2EE框架的架构与应用
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
在电子商务和企业级应用软件开发中,J2EE技术占有十分显著的地位。传统的基于EJB的J2EE架构的优势是它的高级J2EE特性和分布式应用,而对于那些不需要这些高级特性支持的应用系统,J2EE所必须的较为复杂的开发和配置,势必降低开发速度,增加开发成本。论文在对J2EE框架技术文献综述的基础上,分析了传统的基于EJB的J2EE框架及技术在目前的电子商务和企业开发中暴露出的缺陷,提出了一种基于多个开源框架的轻量级J2EE开发架构的解决方案,并以此架构成功开发了网上书店系统。实践结果表明,该系统具有平台无关性,可维护性,可扩展性,可移植性和组件的可复用性,进而验证了轻量级J2EE开发架构的有效性。论文主要工作如下:
     (1)具体分析了Struts、Spring、Hibernate在分层结构的轻量级Web应用的不同层次的作用,并整合这三种框架,设计了一种适合企业Web应用的Java通用架构。该架构将Struts中的业务逻辑交给Spring管理,相关类用Spring的beans配置完成;由Hibernate负责数据的持久化,Hibernate的事务管理交由Spring管理。
     (2)在对轻量级容器的核心机制分析的基础上,重点讨论了其中控制反转模式的实现策略及特点。论文采用Spring轻量级容器,为业务层组件管理提供了一种有效的工具,实现了业务层组件和容器间、组件和组件间低耦合,同时提高了应用开发的灵活性和可测试性。
     (3)使用所设计的架构,开发了网上书店系统。表示层基于Struts框架开发,并使用了JSTL、Validator、Tiles等组件;业务逻辑层基于Spring框架,使用了AOP、IoC组件;持久层使用Hibernate框架实现。论文通过Spring整合各层资源,使用DAO方式和数据持久层交互,以Service方式向表示层提供服务。论文采取了多种方式改善框架性能,引入了缓存组件EHCache和数据库连接池组件Proxool。通过设置缓存机制,极大改善了系统的性能。
The J2EE technologies hold an extremely remarkable status in the e-business and enterprise application system developments. But many projects do not need advanced J2EE characteristics and distributed applications that are the advantages of the traditional J2EE framework, the complex development, configuration, deployment of advanced J2EE characteristics and distributed application will greatly slow down the development and increase the enterprise's cost. On the basis of summarizing literature about J2EE technologies, the thesis analyzes these limitations when traditional J2EE framework which is based on EJB develops the e-business and enterprise system. The thesis proposes a lightweight J2EE framework scheme which is based on open source frameworks and lightweight container. On last chapters, the thesis develops the online book store system using the scheme. The result shows the system bears independency of platform, and has these characteristics of high maintainability, expansibility and reusability on components. And then the practice proves the lightweight J2EE development framework is available. Work in the thesis is shown as follows:
     (1)The thesis researches Struts, Spring and Hibernate frameworks, and analyzes each framework's function in web applications which are based on hierarchical structure. The thesis constructs a common Java architecture which is suitable for enterprise web application by integrating with three frameworks. The framework hands Struts business logic to Spring, utilizes Spring's beans configuration to manage the related classes; manages objects' relation of between controller and data access object through Spring and implements data persistence by Hibernate. The framework takes Spring to manage transaction.
     (2) On the basis of analysis aiming at lightweight container's core mechanism, the thesis focuses on the strategy and characteristic of Inversion of Control pattern. Using spring framework, the thesis provides effective tool to manage business layer components. The thesis implements the low coupling between the components of business layer and the container, also between the components and components, and meanwhile enhances the flexibility and the testability of the application development.
     (3) The thesis develops online book store by using the framework proposed in the thesis. The presentation layer is implemented by Struts framework, and uses these components such as JSTL、Validator Tiles. The business layer bases on Spring framework, and uses AOP and IoC components. The system uses Hibernate framework to implement persistence layer. All resources from layers are integrated by Spring. DAO layer and data persistence layer are interactive through Spring. Spring provides service to presentation layer also. The thesis upgrades system's performance by importing cache component EHCache and Pool component Proxool. It shows the system performs better when using EHCache and Proxool.
引文
[1]Eric Armstrong,Jennifer Ball,Stephanie Bodoff,etc,The J2EE~TM1 1.4 Tutorial-for sun java system application server platform edition 8.2[OL].2005-12,3,11
    [2]张世琨,张文娟,常新等,基于软件体系结构的可复用构件制作和组装[J],软件学报,2001,12(9),1351-1359
    [3]Kirk Pepperdine,Joseph Ottinger,The role of JNDI in J2EE[OL],http://www-128.ibm.com/developerworks/java/library/j-jndi/,2005-01
    [4]Bruce Tate,Secrets of lightweight development success[OL],http://www.ibm.com/developerworks/java/library/os-lightweight(*)/,2005-06
    [5]Deepak Alur,John Crupi,Dan Malks,Core J2EE Patterns-Service Locator[OL],http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html
    [6]Deepak Alur,John Crupi(著),刘天北等译,J2EE核心模式(原书第2版)[M],北京:机械工业出版社,2005-03
    [7]Martin Fowler,Inversion of Control Containers and the Dependency Injection pattern[OL],http://www.martinfowler.com/articles/injection.html,2004-1-23
    [8]Aslak Hellesoy,Jon Tirsen,PicoContainer's Introduction,http://www.picocontainer.org/introduction.html
    [9]罗强,轻量级容器的研究与应用[D],工学硕士学位论文,武汉:武汉理工大学,2007-05,22-23
    [10]张友生,软件体系结构[M],北京:清华大学出版社,2004
    [11]杨奇,周波,RUP在小型J2EE项目中的应用[J],计算机工程与应用,2005,31,226-228
    [12]Mary Shaw,David Garlan,Software Architecture:Perspectives on an Emerging Discipline,Prentice Hall,1996-04
    [13]Joshua Kerievsky,Refactoring To Patterns[M],Pearson education,Inc.2005,23
    [14]梁义芝,王延章,赵晓哲等,软件领域中的模式研究[J],计算机科学,2003,30(3),149-152
    [15]莫勇腾,深入浅出设计模式[M],清华大学出版社,2006-9,35-36,83
    [16]钟茂生,王明文,软件设计模式及其使用[J],计算机应用,2002,22(8),32-35
    [17]童立,马远良,设计模式在基于组件的框架设计中的应用[J],计算机工程与应用, 2007,17,123-124
    [18]陈云望,轻量级框架在J2EE开发中的研究及应用[D],工学硕士学位论文,北京:北京交通大学,2006,12
    [19]王爱冬,张涛,阳国贵,J2EE项目中多设计模式集成应用研究[J],微计算机信息,2007,33,282-283
    [20]姚延涛,王煜,沈钧毅,采用增强的MVC模式提高面向对象应用能力[J],小型微型计算机系统,2002,23(12),1146-1448
    [21]何成万,余秋惠,MVC模型2及软件框架Struts的研究[J],计算机工程,2002,28(6),275-276
    [22]张绍成,李华林,马玉琴,基于Java的对象持久化方法研究[J],小型微型计算机系统,2005,26(2),264-267
    [23]Hibernate Reference Documentation,version3.1.3[OL],http://www.hibernate.org
    [24]刘君强,顾海全,王讯等,基于开源框架的高质量J2EE应用架构[J],计算机工程与设计,2007,28(1),16-18
    [25]施伟,张忠能,轻量级容器的设计与应用[J],计算机工程,2006,32(20),65-66,71
    [26]夏昕,曹晓刚,唐勇,深入浅出Hibernate[M],北京:电子工业出版社,2006-08,45-46,207
    [27]林信良,Spring技术手册[M],北京:电子工业出版社,2006,73-125
    [28]侯婷,基于Struts和Hibernate框架构建Web应用的研究与实现[D],工学硕士论文,武汉:武汉理工大学,2006-04
    [29]Rod Johnson,Juergen Hoeller,Alef Arendsen,etc.,Spring java/j2ee Application Framework 2.0.7 reference[OL],http://sourceforge.net/project/showfdes.php?group_id=73357,2006-10
    [30]Martin Fowler,Patterns of Enterprise Application Architecture,Addison-Wesley Professional,2003-08,116
    [31]Rod Johnson(著),JavaEye(译),Expert One-on-One J2EE Development without EJB中文版,电子工业出版社,2005-08,chapter10
    [32]慧典市场研究报告网,中国网上书店的现状分析和对策研究报告(2006)[R],http://www.hdcmr.com/article/yjbg/13/08/5728.html,2006-07
    [33]Christian Bauer,Gavin King,Java Persistence with Hibernate[M],Manning Publications Co.,2007,698-699,708-717
    [34]Chris Richardson(著),李琳骁(译),王海龙(译),POJOS in Action中文版:用轻量级框架开发企业应用[M],北京:电子工业出版社,2007-04,33-37,48-50
    [35]刘壮,基于Spring+Hibernate的开发方法研究及实例[D],工学硕士学位论文,长春:吉林大学,2005-12
    [36]徐鹏,轻量级J2EE架构的研究与应用[D],工学硕士学位论文,成都:电子科技大学,2007-05
    [37]The Java EE 5 Tutorial:For Sun Java System Application Server9.1[OL],Sun Microsystems.Inc.2007-09,55-62,48

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700