用户名: 密码: 验证码:
基于多框架的黄金交易系统的研究与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
近年来,不断涌现的新框架给J2EE Web应用带来契机的同时,也给软件工程师们带来最大的挑战:如何在纷繁复杂的框架中进行选择和组合,来开发扩展性好,重用性高,易维护,易管理Web应用系统,以应对复杂多变的市场需求。
     针对以上问题,论文在认真的研究了Struts,Spring,Hibernate等Java主流框架的基础上对其进行了深入的分析:Struts实现了MVC模式,很好地实现了业务逻辑与用户界面的分离,将模型和视图从底层事务处理分割开来,使代码结构条理化,便于维护,但其对业务层支持不足;Spring是一个职责定义明确的业务层框架,并实现了业务逻辑和数据持久化的分离,这样使层次结构更加清晰,便于维护和代码冗余减少,不足之处是虽然它在每个层次都有体现,但其比较稚嫩(如在显示层不如Struts);Hibernate是独立的持久层技术,它在数据库外裹了一层面向对象的外衣,Java程序中所有进行的数据库的操作都交给Hibernate来处理,程序员不再写繁琐的SQL语句。从以上分析不难看出,对Struts,Spring,Hibernate进行整合,扬其长,避其短,是一种必然的趋势,也正是本文研究的重点。
     在整合过程中,以Struts为骨架,利用Struts的动态插入和加载组件的功能,把Spring框架以插件的形式插入到Struts框架中;由于Spring是基于容器对事务进行管理,并对Hibernate的集成提供了支持,通过配置文件把Hibernate移交给Spring容器进行集中管理。这样它们就被有机的整合在一起,Struts可以专门实现流程控制和页面导航而不必关心业务逻辑;Spring就可以发挥它在事务管理和依赖注入方面的特有的优势而不必担心在流程控制上的苍白;Hibernate为持久层提供便捷的持久化服务。显而易见,整合后的框架是一套松散耦合,层次清晰,便于移植,易于维护和管理的Web应用框架。最后,结合实际项目—上海黄金交易系统,对整合框架的优势和可行性进行了验证。
In recent years, the huge emergence of new J2EE Web application frameworks brings a lot of opportunities for the software engineers to learn and use them, but it also brings the biggest chanllenge: how to choose frameworks from those new emerging ones and combinate them to develop scalable, and highly reusabile, and easily maintainable and manageable Web application system to meet the complicated and ever-changing requires of the market.
     In view of the above problems, plenty of research about Struts, Spring, Hibernate and other popular Java frameworks is done in this thesis ,meanwhile, some insightful analysis is proposed as follow: Struts realizes MVC model and successfully separates the business logic tier form view tier and consequently, the code structure is coherent, easy to maintain, but it does little thing to business logic processing; Spring is business tier framework, of which the responsibilities is clearly defined and the separation between business logic and data saving is achieved. Obviousely, it is more clear, easy to maintain and can reduce a amount of redundant code, however, the shortcoming is that it embodies at every layer but unsophisticated (not as good as Struts at view tier); Hibernate is an independent technology at persistence layer, and wraps the database with an object-oriented coat. As a result, all of database operation is handed over to Hibernate to deal with and the programmers do not have to write tedious SQL statements any longer. From the above analysis, it is safe to say that the integration among Struts, pring and Hibernate is an inevitable trend and it was also the focus of this paper.
     In the course of integration, Struts framework works as a skeleton, considering its fuction of components loading and inserting dynamically, and Spring framework is inserted into Struts framework as plug-ins; since the transaction management of Spring is based on container, and also provide the support for Hibernate Integration, we can leave Hibernate to the Spring container to manage. By organic integration, Struts can centre on process controlling and pages navigating without having to concern business logic; Spring can play more important roles in transaction management and dependency injection without fear of its deficiency in process controlling; Hibernate can provide convenient and earsy achievements for persistence layer. The integrated framework, apparently, is a loosely coupled, structure-clear, conveniently transplantable, easily maintenable and manageable Web application framework. Finally, with the practical projects-Shanghai Gold Exchange system, the advantages and feasibility of this integrated framework are testified.
引文
[1]孙卫琴.精通Struts:基于MVC的Java Web设计于开发[M].北京:电子工业出版社,2005,2.
    [2]张友生.软件体系结构[M].北京:清华大学出版社,2004.
    [3]王洁.MVC模式在java中的应用[J].华南金融电脑.2003,11(7):53-54.
    [4]http://dev.csdn.net/author/lin_bei/4c6836ca69cd47b09c35ae3af32a64a0,html
    [5]George F,Danilo G.Struts Recipes[M].Manning Publications,2004,12.
    [6]Steven H.Struts:Essential Skills[M].American:McGraw-Hill,2007,7.
    [7]Doray A.Beginning Apache struts:From Novice to Professional[M].Apress,2006,2
    [8]邱哲,王俊标,冯斗.Struts Web设计与开发大全[M].北京:清华大学出版社,2006,2.
    [9]罗时飞.精通Spring[M].北京:电子工业出版社,2005.
    [10]Howard M.Lewis Ship.Spring in Action[M].Softbound,2005.
    [11]http://www.boraid.com/bbs/printpage.asp
    [12]http://spring.jactiongroup.net/viewforum.php
    [13]Matt R.Spring Live[M].Sourcebeat,2004.
    [14]王家顺.业务逻辑层模型的研究与应用:(硕士学位论文).大连:大连海事大学,2006.
    [15]林信良.Spring技术手册[M].北京:电子工业出版社,2006,6.
    [16]Rob Harrop,Jan Machacek.Pro Spring[M].Apress,2005,1.
    [17]李风.基于Spring和Hibernate的企业信息发布系统:(硕士学位论文).北京:北京邮电大学,2006.
    [18]http://www.cn-java.com/download/SpringGuide.pdf
    [19]吴炜煜.面向对象分析设计与编程(OOA/OOD/OOP/AOP)[M].北京:清华大学出版社,2007,1
    [20]刘壮.基于Spring+Hibernate的开发方法研究及实例:(硕士研究生论文).吉林:吉林大学,2005.
    [21]Justin Gehtland.Spring:A Developer' Notebook[M].Sebastopol:O'Reily Media,2005.
    [22]李晓军,陶勇.Hibernate,ORM最佳实践[M].北京:清华大学出版社,2007,9.
    [23]刘洋.精通Hibernate[M].北京:电子工业出版社,2005.
    [24]Clifton Nock著.鄢爱兰,王安鹏等译.数据访问模式:面向对象应用中的数据库交互[M].北京:中国电力出版社,2004.
    [25]何铮,陈志刚.对象-关系映射框架的研究与应用[J].计算机工程与应用,2003:45-50.
    [26]张淑全.基于Hibernate的数据层设计模式的研究与实现:(硕士学位论文).大连:大连海事大学,2006.
    [27]夏昕,曹晓刚,唐勇.深入浅出Hibernate[M].北京:电子工业出版社,2005,5.
    [28]蔡学焘.Hibernate开发及整合应用大全[M].北京:清华大学出版社,2006,3.
    [29]James Elliott.Hibernate:A Deveoper's Notebook[M].O'Reilly,2004,5.
    [30]Patrick Peak,Nick Heudecker.Hibernate Quickly[M].Manning Publictions,2005,8.
    [31]孙卫琴.精通Hibernate:Java对象持久化技术详解[M].北京:电子工业出版社,2005.
    [32]Megumi Nishimru.Web应用程序--CGI到Web三层系统[M].北京:科学出版社,2004,9.
    [33]James Turner,Kevin Bedell.Struts KickStart[M].Sams,2002,12.
    [34]王永珍.基于MVC模式的武器装备管理信息系统:(硕士学位论文).吉林:吉林大学,2006.
    [35]Chuck Cavaness.Programming Jakarta Struts[M].American:O' Reilly Media,2004,6.
    [36]廖江福.基于Struts-MVC架构的现代营销仿真模拟教学系统的分析,设计与实现:(硕士学位论文).长沙:国防科技大学,2005.
    [37]http://struts,apache,org/primer,html
    [38]James Holmes.Struts:The Comlete Reference.Mcgraw-Hill Osborne Media,2004,12.
    [39]刘斌.精通Java Web整合[M].北京:电子工业出版社,2007,1.
    [40]全校春,宋述燕.利用Spring集成Struts+Hibernate框架业务系统设计与研发[J].中南民族大学学报.2007,26(1):48-53.
    [41]http://community,csdn.net/default,aspx
    [42]柏银.基于Struts_Spring_Hibernate多架构的性能分析系统:(硕士学位论文).四川:四川大学,2006.
    [43]http://www,sge.sh/web/show_col.asp
    [44]萨师煊,王珊.数据库系统概论[M].北京:高等教育出版社,2000.
    [45]http://www.jcp.org/aboutJava/communityprocess/first/jsr012/index.html,2003
    [46]王成良,杨祥凌.对象模型向关系数据库模型映射的策略及其应用[J].计算机工程,2004:68-73.
    [47]Scott W.Ambler.The Design of a Robust Persistence Layer for Relational Database,http://www.ambysoft.com,2000-11-28
    [48]http://www.uml.org.cn/mxdx/200609273.htm
    [49]Kirk Knoemschild,罗英伟,汪小林译.Java设计:对象,UML和过程[M].北京:人民邮电出版社,2003:36-40.
    [50]Savitha Srinivasan.Design Patterns in Object-Oriented Frameworks[M].Computing Practices,1999.
    [51]付京周.精通Hibernate3.0-Java数据库持久层开发实践[M].北京:人民出版社,2007,5.
    [52]http://www.j2eedve,com
    [53]李红辉,黎永强,刘开.Hibernate技术在综合网管上应用的研究[J].北京:北京交通大学出版社,2006,6(1):48-53.
    [54]http://www.sudu.cn/info/htmt/edu/code/list_56_245.html
    [55]王克宏.Java技术教程[M].北京:清华大学出版社,2002,4.
    [56]张跃平.Java2实用教程[M].北京:清华大学出版社,2001,10.
    [57]Arnold,Gosling,Holmes.Java编程语言[M].北京:中国电力出版社,2003,12.
    [58]王涛,刘继光,刘勇等.Java2 API大全[M].北京:电子工业出版社,2003,1.
    [59]常伟.基于MVC的银监会高管人员信息系统的分析与设计:(硕士学位论文).南京:南京航空航天大学,2006.
    [60]高红岩.Struts实用开发指南--基于MVC+MyEclipse的Java Web应用开发[M].北京:科海电子出版社,2007,7.
    [61]http://www-128.ibm.com/developerworks/cn/java/index.html

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

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

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