JAVA轻量级架构在电子商务系统中的应用与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
近年来,随着Internet技术和企业信息化建设的发展,构建基于Web的应用系统的需求越来越复杂,开发周期越来越紧迫。对于复杂多变的市场环境,开发伸缩性强、扩展性好、重用性高和易维护、易管理的Web应用是当前Web技术发展的热点之一。
     当前基于J2EE平台的Web应用在逻辑上一般被分为四层:域模型层、表示层、业务层、持久层。这种多层的体系结构向开发者提供了一种基于组件的设计和开发Web应用的模块化方法。应用系统各层的实现技术多种多样,每种技术都有其优缺点和最适用的范围,怎样选择各层的技术以及如何结合这些技术来实现一个应用系统是一个值得进一步考虑的问题。本文主要针对表示层、业务层和持久层的实现提出了基于Struts+Spring+Hibernate的解决方案。Struts是一个致力于组件化和代码重用的MVC模式实现框架,以其灵活、强大的功能为Web应用的构建减轻了负担。Spring是一种轻量级的容器,区别于EJB的强侵入式,Spring的依赖注入功能,使系统各组件间达到松散耦合并且能和各种框架很好的兼容。Hibernate是一个开源的持久层框架技术,全面减轻了维护数据的复杂度,使系统具有良好的性能和移植性。
     本文以基于J2EE体系的Web开发方法为探讨的基线:首先,探讨了MVC模式,再到实现MVC模式的Struts框架内部机制的探讨;接着,根据Web应用的经典分层理论,对持久层的设计进行了分析,引入了Hibernate框架技术;然后,应用Struts作为表示层实现,应用Hibernate作为持久层实现,并结合Spring技术作为业务层实现,进行框架整合,从而设计出了一套足够灵活、松散耦合、可扩展且高效的Web开发框架;最后,详细论述了该架构在蝴蝶电子商务系统中的应用。通过实践表明,应用这种系统框架可以提高系统开发的效率,同时满足系统扩展性和可维护性的要求。
In recent years,there has been greater demands for application Systems based on Web to meet more complicated requirements,shorter R & D time.So the application of Web which has better development,maintainability,expansibility,repeatability and easy management,is the hotspot of the Web technology.
     At present according to the Web application of J2EE terrace at logical is been divided into 4 F generally:Domain Model Layer,Presentation Layer,Business Layer and Persistent Layer.This kind of multi-layer system structure provided 1 kind according to the module toward the developer of the mold piece of design and development Web application turn a method.Applied carry out of each layer of system technique is varied and grow techniques to all have it the merit and shortcoming each time with the most suitable use of scope,how choose each technique and how combine these techniques to carry out an applied system is a worthy of consider further of problem.This text mainly aims at to mean a layer,business layer with held out for long time the realization of layer to put forward according to the Struts+Spring+Hibernate solution.Struts is a 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 is designed with dependency injection and can make component loose coupling dynamically and compatible with other framework.Hibernate is an open source persistence framework,which entirely reduces the complexity of maintaining data and make system have higher performance and portable.
     The paper is based on the Web development methods of J2EE architecture.Firstly,discuss the MVC module and the discuss of internal mechanism of Struts architecture which implementing MVC pattern;Secondly,I applied the Struts to the presentation layer,applied the Hibernate to the persistence layer,applied the Spring to the business layer,conformed in framework and constructed a flexible,loosely coupled,extensible and high performance developing architecture.Finally,an example based on Liang Zhuang E-Commerce System is introduced to illustrate the process to build an multi-tiers system with the help of the architecture.Results show that this new framework helps to increase work efficiency in exploration.Meanwhile,expansibility and maintainability of the system within this framework are also satisfactory.
引文
[1]孙卫琴 《精通Struts:基于MVC的Java Web设计与开发》 电子工业出版 2004
    [2]孙卫琴,李洪成 《Tomcat与Java Web开发技术详解》 电子工业出版社 2002
    [3]Cay S.Horstmann,Gary Comell 《Core Java 2,Volume 1-Fundamentals(Seventh Edition)》 Pearson Education 2005
    [4]白尚旺,党伟超 《PowerDesigner软件工程技术》 电子工业出版社 2004
    [5]Joseph Schmuller 李虎,赵龙刚译 《UML基础、案例与应用》 人民邮电出版社
    [6]陈天河 《Struts、Hibernate、Spring集成开发宝典》 电子工业出版社 2007
    [7]Cbuck Cavaness 孙江宏,杨继萍译 《Jakarta Struts编程》 清华大学出版社 2004
    [8]Richard Hightower,Nicholas Lesiecki 唐一丁,蔡永航译 《Java极限编程》机械工业出版社 2004
    [9]李刚 《Spring2.0宝典》 电子工业出版社 2006-10
    [10]罗时飞 《精通Spring》 电子工业出版社 2005.4
    [11]薛四新,贾郭军 《软件项目管理》 机械工业出版社 2004.5
    [12]Elisabeth Freeman,Eric Freeman,Bert Bates,Kathy Sierra 《Head First Design Patterns》 O'Reilly 2004-10
    [13]Alan Shalloway,James Trott 《Design Patterns Explained:A New Perspective on Object-Oriented Design,2nd Edition》 Addison-Wesley Professional 2004-10
    [14]Jason Brittain,Ian F.Darwin 《Tomcat:The Definitive Guide》 O'Reilly Media 2003-6
    [15]张洪伟 《Tomcat Web开发及整合应用》 清华大学出版社 2006.2
    [16]刘晓华 《J2EE企业级应用开发》 电子工业出版社 2003.8
    [17]阎宏 《Java与模式》 电子工业出版社 2004
    [18]柯自聪 《Ajax开发精要》 电子工业出版社 2006
    [19]孙卫琴 《精通Hibernate:Java对象持久化技术详解》 电子工业出版社 2005
    [20]夏昕,曹晓钢,唐勇《深入浅出Hibernate》电子工业出版社2005
    [21]汪海瑛基于Java Web技术实现MVC架构的研究与应用硕士论文华北电力大学2003
    [22]陈大鑫基于MVC模型的远程考试系统的研究与开发 硕士论文 中南大学2004
    [23]于洋,芦东昕,方马 运用Struts的MVC设计模型 计算机应用杂志2003(S2)
    [24]吴昊 基于Struts和Hibernate构建GSM电子运行维护系统 硕士论文四川大学2005
    [25]Jason Hunter 《Java Servlet Programming,2nd Edition》 O'Reilly 2001
    [26]James Tumer,Kevin Bedell 《Struts Kick Start》 Sams 2002
    [27]韩淼 基于J2EE的一种多层Web系统通用框架的设计及应用 硕士论文大连理工大学2005
    [28]刘状 基于Spring+Hibernate的开发方法研究及实例 硕士论文 吉林大学2005
    [29]Rod Johnson,Juergen Hoeller,Alef Arendsen,Thomas Risberg,Colin Sampaleanu 《Professional Java Development with the Spring Framework》Wrox 2005
    [30]寇毅,吴力文 基于MVC设计模式的Struts框架的应用方法 计算机应用杂志2003,23(11)91-93
    [31]Rod Johnson 《Expert One-on-One J2EE Design and Development》 Wrox 2002-10
    [32]Rod Johnson,Juergen Hoeller 《Expert One-on-One J2EE Development without EJB》 Wrox 2004-6
    [33]陈虹 基于J2EE的税务查帐软件设计 硕士论文 同济大学2006
    [34]管兆宁 基于J2EE的图书信息网站的设计与实现 硕士论文 苏州大学2005
    [35]罗红梅 集成Hibernate、Spring和Struts的架构应用研究 硕士论文 电子科技大学2006-3

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

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

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