基于设计模式的Web系统重构的研究及其在财务稽核系统的实践
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
Web的流行直接导致了基于B/S结构的Web系统在软件中所占的比重越来越大,使用越来越广泛。但是伴随着Web系统的迅速增多和它们的飞速发展,系统也出现了诸多预想不到的问题,包括层次结构混乱、功能模块设计不合理、紧耦合、功能单一或者庞大,代码冗余,类和方法设计不合理以及系统可移植性和可维护性差等问题。为了解决Web系统所面临的问题,本文引入设计模式提出了对Web系统重构的一种解决方案。
     设计模式是对被用来描述特定场景下解决一般设计问题的类和相互通信的对象的描述。设计模式是微体系结构(Micro-Architecture),相对类和对象来说它是更高级别的构建模块类或对象的组合。每个设计模式描述了各自的应用领域和基本原则。设计模式提供了设计级的复用性和灵活性,使软件对需求变化的敏感度降低。
     重构(Refactoring)就是在不改变软件现有功能的基础上,通过调整程序代码改善软件的质量、性能,使其程序的设计模式和架构更趋合理,提高软件的扩展性和维护性。尽管表面上重构是代码的一种整理,实际上却是对代码中蕴含的设计的调整。在某种意义上,设计模式作为重构的目标指导重构的进行。
     本文首先介绍了财务稽核系统的情况,详细阐述了系统存在的、亟待解决的问题,这是研究的目的。然后介绍了设计模式的相关理论,包括设计模式的定义、描述以及在Web系统重构过程中起到指导作用的重点设计模式的介绍。接着对系统重构的相关理论进行简单的描述,包括重构的概念、重构的原则以及重构的原子方法,并对设计模式与重构之间的关系进行了分析和总结。这是本文研究的理论依据。接着对目前的Web系统所遇到的普遍性的问题进行了总结和分析,创新性的提出了一套针对Web系统重构的解决方案,详细的描述了Web系统重构的过程,提出了对Web系统在三个不同级别上的重构——层级重构、模块级重构和实现级重构,用于指导系统的重构,有效的解决了系统层次混乱,功能模块之间紧耦合,功能重复以及类和方法设计不合理等Web系统所面临的普遍问题。这是本文的重点论述内容和研究成果。最后在此解决方案的指导下,实现了财务稽核系统在层级、模块级以及实现级的重构,从而解决了系统遗留的问题,提高了系统的可维护性和可移植性。
     本文提出的对Web系统重构的解决方案是一种行之有效的解决方案。从层级、模块级以及实现级对Web系统的重构也是一种新的重构理念,在很大的程度上降低了Web系统重构的难度。
With the popularity of Web, the proportion of B / S-based web system to software is increasing, and the use of them is more extensive. But with the increase in Web system and its development, the system has emerged many unexpected issues, including confusion of level, unreasonable functional modules, tight coupling, functional duplication, redundant code, and unreasonable methods or classes of system design, as well as unreasonable poor portability and maintainability of system. To resolve these Web system problems, the paper proposed a solution that refactoring the web system which based on design patterns .
     Design Pattern is used to describe the classes that resolve general design issues and the object that communicate with each other in specific scenes. Design pattern is micro-architecture, compare to classes and objects, it is a higher-level building blocks of object or a combination of objects. Each pattern describe their areas of application and basic principles. Designed to provide the reusability and flexibility in design level for software, and reduce the sensitivity to change of requirement of software.
     Refactoring means not to change the existing functions of software, through the process of adjustment of software code, to improve the quality and performance of software, to make the design of its procedures and structure more rational, so improve the scalability and maintainability of software. Although on the surface, refactoring is a arrangement process of code, the code is actually contained in the design of adjustment. In a sense, design pattern as the goal of guiding the conduct of Refactoring.
     In this paper, we firstly introduced the financial audit system, described the problems that are existed in this system and the urgent need to resolve the issue in detail, which is the purpose of the study. Then we introduced the theory of design patterns, including the definition of design patterns, as well as the important design patterns which play a guide role in the refactoring of Web system. Also we simply describe the theory of system refactoring, including the definition of refactoring, the principle and atomic methods of refactoring, then we analyzed and summarized the relationship between design pattern and refactoring. This is the theoretical basis for this study. Then we analyzed the current universal problems of Web system, innovatively raised a set of Web system refactoring solutions, described the refactoring process of Web system in detail, proposed the refactoring implementation for Web system from three different levels - layer level, module level and implement level, which is an effective solution for the problems of system-level confusion, tight coupling between functional modules, duplication of functions, as well as unreasonable classes and methods and so on, they are all widespread problems that web system faced with. This is the focus of this paper on the content and research results. Finally, under the guidance of this solution, we achieved the refactoring of financial audit system from layer level, module level and implement level, so as to solve the remaining problems in the system, improve the system's maintainability and portability.
     The new Web system refactoring solution is a effective solution, and refactoring from three different levels is a new refatoring theory which bestially reduce the difficulty of Web system refactoring.
引文
[1]TM Forum,Revenue Assurance Overview Public Version 0.4,April 2005
    [2]Alexander H,Zhang Qun,Alexander RB,et al.The importance of telco's revenue assurance function study[C].Communication Technology Proceedings.NJ:Institute of Electrical and Electronics Engineers Inc,2000(1):826-833
    [3]Christopher Alexander,Sara Ishikawa,Murray Silverstein,Max Jacobson,Ingrid Fiksdahl-King,and Shlomo Angel.A Pattern language.Oxford University Press,New York,1977
    [4]周爱民著,大道至简—软件工程实践者的思想,中国发展出版社,2006.06
    [5]Erich Gamma,Richard Helm,Ralph Johnson,John Vlissides著,李英军,马晓星,蔡敏,刘建中等译,设计模式:可复用面向对象软件的基础,机械工业出版社,2000年9月
    [6]Deepak Alur,John Crupi,Dan Malks著,刘天北,熊节等译,J2EE核心模式,机械工业出版社,2005.03
    [7]Frank Buschmarm,Regine Meunier,Hans Rohnert,Peter Sommerlad,Michael Stal著,贲可荣等译,面向模式的软件体系结构卷1:模式系统,北京,机械工业出版社,2003年01月
    [8]孙卫琴 编著,精通Struts:基于MVC的Java Web设计与开发,北京:电子工业出版社,2002年8月
    [9]夏昕,曹晓钢,唐勇著,深入浅出Hibernate,北京:电子工业出版社,2005.06
    [10](美)梅特斯克,(美)韦克著,龚波,赵彩琳,陈蓓译,Java设计模式,人民邮电出版社,2007.03
    [11]张翔,基于设计模式的企业级应用框架研究,天津大学,2005.01
    [12]Stephen Stelting,Olav Maassen,Java模式应用(影印版),科学出版社,2004.01
    [13]Martin Fowler,分析模式——可复用对象模型(影印版),中国电力出版社,2003.07
    [14]Joshua Kerievsky著,Refactoring to Pattern中文版,人民邮电出版社,2006.12
    [15]Robert C.Martin著,敏捷软件开发-原则、模式、实践,清华大学出版社,2003年10月
    [16]Martin Fowler著.,侯捷译,重构:改善既有代码的设计,中国电力出版社,2003.8
    [17]李进闯著,系统重构在软件开发中的应用,南开大学,2003.04
    [18]刘国钦著,基于Web的软件系统中重构技术研究与应用,大连理工大学,2005.01
    [19]GradyBooeb著,面向对象分析与设计(影印版),北京,中国电力出版社,2003.09
    [20]William C.Wake(美)著,林琪,江健译,重构手册,中国电力出版社,2004.06,第1版
    [21]阎宏著,Java与模式,电子工业出版社,2002.10
    [22]Stephen Stelting,Olav Maassen著,Java模式应用,科学出版社,2004.01
    [23]孙卫琴著,精通Hibernate:Java对象持久化技术详解,电子工业出版社,2005.5

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

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

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