当前位置:文档之家› 5外文翻译原文1

5外文翻译原文1

A Case Study of Pattern-based Software Framework toImprove the Quality of Software DevelopmentChih-Hung Chang,Chih-Wei LuDept. of Information Management, Hsiuping Institute of Technology No.11, Gongye Rd., Dali City, Taichung County,Taiwan(R.O.C.)886-4-24961123 ext 3112 {chchang,cwlu}@.twWilliam C. ChuDept. of ComputerScience and InformationEngineering,Tunghai UniversityNo.181, Sec. 3, TaichungPort Rd.,Taichung City,Taiwan (R.O.C.)886-4-23508983cchu@.twNien-Lin HsuehDept. of InformationEngineering andComputer Science,Feng Chia UniversityNo. 100 Wenhwa Rd.,Taichung, Taiwan (R.O.C.)886-4- 24517250 ext 3773nlhsueh@.twChorng-Shiuh KoongDept. of Computer andInformation Science,Taichung UniversityNo.140, Ming-Sheng Rd.,Taichung City,Taiwan (R.O.C.)886-4-22183804csko@.twABSTRACTIn recent years, development of the software industry and demand for software systems have increased rapidly, but developers often does not know whose suggestion to follow regarding methodologies of software engineering. One reason for that is the difficulty in applying new software engineering technologies. Developers take a long time to train. Another reason is the difficulty in integrating CASE toolsets. So many indeterminate factors make the development process more and more complex. On the other hand, software development is too customized, and software reuse is difficult. T he reasons above are the cause for software development and maintenance to become more complex and difficult to control.In this paper we explore the importation of a software pattern-based framework, and the development of an ERP/support chain system. Based on software patterns, developers can separate development and business so as to reduce problems caused by the developer’s lack of business experience. T he quality of the product can thus be enhanced, software development costs be reduced, and software maintenance be improved.KeywordsDesign Pattern, Framework, Software Development Process, XML1.INTRODUCTIONIn Object-Oriented T echnology, the property of inheritance allows software components to be reused, which can obviously reduce the cost of software development. For this reason, to produce a highly reusable software component is an important goal of software engineering. However, programmers are usually focused on code reuse while ignoring design reuse. Design patterns provide a clear concept of design structure by describing the relationships of inheritance and reference between components of the system.Design patterns are a series of familiar usages and constructions utilized throughout system design. Design patterns allow rapid coding of certain components by following certain patterns of steps. T his can improve the documentation and maintenance of existing systems by providing an explicit specification of class, object interactions and their underlying intents. One of the main purposes of design patterns is to help software engineers to understand the common characteristics of software objects/components in specialized domain.In recent years, due to the development and maturation of WWW and Java [14] technologies, many applications are now web applications or leaning in that direction. Many software concepts are utilized for the web as well, such as Design Patterns and Frameworks. The Apache Struts [12] and Spring Framework [13] are both open source frameworks used to address and reduce the complexity of developing an enterprise application. T he advantage of using a framework is the layered architecture it provides. Layered architecture allowed users to choose the component desired, while also providing the integration framework when developing application using J2EE. T hese developing web concepts can facilitate the development of web applications. However, these very useful tools and concepts lack a systematic organization.We hope to use these open source software technologies to develop a software framework which can be applied to web application. T his should solve the problem of web applications lacking a good structure, while through applying these open source software technologies, software development costs will be reduced. Furthermore, a guideline for programmers who wants to use these open source technologies will be provided.This paper is organized as follows: In the next section, we discuss works related to our project; in section 3, the open source technologies used in the paper and the system implementation will be described; Section 4 is a sample experiment. T heconclusion is given in section 5.2.RELATED WORKS2.1Design PatternsPatterns facilitate reuse of well-established solutions when known problems are encountered. They support higher abstraction levels than traditional object-oriented individual classes and instances [1]. Alexander et al. [19] discussed the pattern: “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice”. Design patterns [1] [2] integrate successful standard design practices and expert experiences into a set of components that exhibit known behaviors, but with better structures. Design patterns are considered one of the most forward-looking methods for modern system analysis and design [18]. Design patterns aim to make it easier for designers to reuse well-known and successful designs and architecture from expert experience. It also helps programmers to choose design alternatives that make a system reusable and avoid alternatives that compromise reusability.2.2FrameworkFramework can be said to be a software concept that contains both software component reuse and design reuse. Any domain software developed on existing architecture will have high reusability if designed with a framework in mind [3]. Framework [4][5][6] is a set of abstract and concrete classes that collaborate with each other, and contain their interface definition of instances [20]. T hese classes are constructed as reusable components for some domain. Designers can inherit from these instances of classes to create new ones. Basically Framework provides an environment to support all activities involved in software development.However, when we attempt to create a composite of different frameworks we may run into some problems. Mattsson and Bosch [7] proposed to apply existing design patterns as a solution to these problems.Applying framework and design patterns to develop systems have increased our work efficiency. Framework is usually used on problems within a specific domain, while design patterns are used to solve general problems. If we can find the design pattern that fits our requirement, we can apply design patterns to any application domain, making design patterns more general than framework.Jacobsen et. al.[8] proposed that if we can use patterns in the analysis, design, and implementation phases of system development, we can develop system that follow the characteristics of design patterns, which can reduce the effort of checking consistency between the phases.In recent years, web applications have been developing quickly. Many software framework technologies that can be applied to web application were proposed, such as Spring Framework [13]. It is an open source framework aiming to address and reduce the complexity of developing an enterprise application.2.3XMLXML [9] is the standard language supported by the World Wide Web Consortium (W3C). XML has many useful features, such as application neutrality (vender independence), user extensibility, the ability to represent arbitrary and complex information, a validation scheme of data structure, and is human readable.XML is also found in certain forms when making data representations in different domain, such as ebXML [10] (Electronic Business using eXtensible Markup Language). It is a modular suite of specifications that enables enterprises to conduct business over the Internet. VoiceXML [9][11] covers voice dialogs, speech synthesis, speech recognition, telephony call control for voice browsers and other requirements for interactive voice response applications, including use by people with hearing or speaking impairments. MathML [9] is a set of low-level specifications for describing mathematics as a basis for machine to machine communication.3.SYSTEM ARCHITECTUREIn this paper we use open source technologies used on many web applications, such as Apache Struts [12], MVC, Spring Framework [13], and Hibernate [15]. We describe their main concepts below:3.1StrutsStruts is a part of the Apache Software Foundation project, under Jakarta. Struts is a flexible control layer based on standard technologies such as Java Servlets, JavaBeans, ResourceBundles, and XML. T he framework helps programmers create an extensible development environment for your application, based on published standards and proven design patterns.Struts is based on a concept known as MVC. T he term “MVC” originated with the SmallTalk Model-View-Controller framework. Under MVC, an application is seen as three distinct parts. T he problem domain is represented as the Model. T he output to the users is the View, and the input from the users is represented as Controller. Struts is composed of a group of collaboration classes/components, and the JSP tag lib servlet.The struts framework provides several components that make up the Control layer of a MVC-style application. T hese include controller components, servlets, developer-defined request handlers, and several supporting objects.The Struts Taglib component provides direct support for the View layer of an MVC application. Some of these tags access the control-layer objects. Other taglibs, including JSTL, can be used with the framework. Other presentation technologies, like Velocity T emplates and XSLT can also be used with the framework.The Model layer in an MVC application is often project-specific. The framework is designed to make it easy to access the business-end of your application, but leaves that part of the programming to other products, such as JDBC, Enterprise Java Beans, etc.3.2Spring Framework [13]Spring is a layered Java/J2EE application framework, based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson [21].As Johnson described [22], Spring is a powerful framework that solves many common problems in J2EE. Spring provides a consistent way of managing business objects, and encourages good practices such as programming to interfaces, rather thanclasses. T he architectural basis of Spring is an Inversion of Control (IoC) container based around the use of JavaBean properties. However, this is only a part of the overall picture: Spring is unique in that it uses its IoC container as the basic building block in a comprehensive solution that addresses all architectural tiers.Spring provides a unique data access abstraction, including a simple and productive JDBC framework that greatly improves productivity and reduces the likelihood of errors. Spring's data access architecture can also be integrated with T opLink, Hibernate, JDO and other O/R mapping solutions.Spring also provides a unique transaction management abstraction, which enables a consistent programming model over a variety of underlying transaction technologies, such as JTA or JDBC. Spring provides an AOP framework written in standard Java, which provides declarative transaction management and other enterprise services to be applied to POJOs or - if you wish - the ability to implement your own custom aspects. This framework is powerful enough to enable many applications to dispense with the complexity of EJB, while enjoying key services traditionally associated with EJB.Spring also provides a powerful and flexible MVC web framework that is integrated into the overall IoC container.Spring consist of seven well-defined modules, as show in figure 1.Figure 1. The architecture of Spring FrameworkEach module (or component) of Spring can stand alone, or be implemented with one or more other modules. Each module functions as follows:Core packaging: T he Core provides the basic functions of the Spring framework. T he main component of core container is BeanFactory, which is the realization of thefactory model. BeanFactory uses Inversion of Control (IoC)to make application configuration, dependence norms andthe actual application code separate.AOP: the AOP module provides implementation of aspect-oriented programming that fits with the AOP Alliance, suchas method-interceptors and point cuts. According to theconfiguration manager function, Spring AOP module integrates aspect-oriented programming into the Springframework. Therefore, it is easy to make any components inSpring Framework support AOP. Besides, Spring AOPmodule can provide transaction management services so wedo not need to be dependent on EJB components. T hetransaction management can be integrated with applicationseasily.DAO: T he JDBC-abstraction layer provides a useful exception control framework. It can be used to manageexception handling and the output messages from databasesbuilt by different vendors. Exception control frameworkssimplify error handling, and decreases the amount ofexception code (for example, opening and closing theconnection) that must be written. Spring-oriented JDBCDAO complies with the common abnormal level DAOframework.ORM: T he ORM package provides integration layers for popular object-relational mapping APIs, including JPA,JDO, Hibernate, SQL map and iBatis. All of these followthe Spring general norms and exception control frameworks. Web: The advantage of the Spring MVC Web framework is that the view layer (JPS, HT ML, or PDF) can be changedeasily and efficiently according to IoC and AOP functions.Furthermore, you can integrate them with your favorite Webframework.JEE: the JEE module contains JMX, JMS, JCS, EJB, Email and several enterprise services. It uses abstract classes toencapsulate the services. It hides the complex details ofsystem logic and thus makes it easily usable by programmers.3.3HibernateHibernate is an Object / Relational Mapping (ORM) solution. Briefly said, the relationship between objects and objects in Java is mapped to a relationship between tables and tables. Hibernate provides an automatic conversion solution in the program process.3.4Figure 2. The system architecture of our frameworkIn order to integrate these open source technologies, we designed a system framework (as show in figure 2).Struts processes the design specifications of the Presentation Layer and Control Layer for communication with users. T he Business Layer is reached through the Spring framework. Furthermore, the Data Access Layer communicates with database by Hibernate. Struts, Spring and Hibernate, each in their own layer, is integrated by XML, thus achieving message exchange and objects mapping relations. Figure 3 shows the integration offramework models as follow.Figure 3. System Integration ModelIn order to integrate several open-source tools, the Spring Framework is used for the core architecture. It included the AOP, ORM, DAO and Core, which are a part of infrastructure class libraries. This is bridged by the front-end web page and back-end Hibernate to exchange information. T his framework is constructed in a Servlet container, the most common being Apache Tomcat [16], but any other well-known Servlet container may be used.In this paper, we integrate these technologies into a framework for the convenience of management and source code classification. In order to maintain uniformity, we put the source code supporting user interaction and presentations together. And we called these the Action Bean.T he src/service folders store the business logic layer produced when integrated with the Spring framework. Moreover, the implements of Hibernate for mapping database relations and objects (Data Access Layer) are stored in the src/dao folder.All objects in development will also produce a group of test cases. T his is extremely effective when used to improve software reliability and software quality control. The tool used is JUnit API[17].Figure 4. The content of applicationContext-resources.xml Compared to code package design and planning, a more important construct is the Spring control layer. All setting files in the controllayer is described by XML. Figure 4 show a detailed XML context as application Context-resources.xml.In Spring framework, it provides an implementation of BeanFactoryPostProcessor class - org.springframework.beans. factory.config.PropertyPlaceholderConfigurer. According to this class, some configurations can be stored in a property file. In this way, XML files store definitions of system configurations, while the property files can contain customized parameters specified by customers. For example, the mail property file, which describesthe details of the mail server, is shown in Figure 5.Figure 5. The content of mail.propertiesIn general, large system development requires teamwork. In order to improve the efficiency of software development and program version control, CVS (Concurrent Versions System) is used.In this paper, we choose Eclipse as the IDE (Integrated Development Environment). T o verify the usability of this framework, we realized the framework on two real business cases. One is a Book Logistic and ERP system, the other is a T ransnational GLM System in traditional industries. Simultaneously, we transplanted an old fortune system in the Office of Student Affairs in our school onto the Web. The original system was a single PC system, and allows only one user at one time. The re-implemented system is now a web-based application, with some new management functions implemented.Because to integrate these open source technologies is quite difficult, we used an open source integration tool appfuse to manage the task.4.EXPERIMENTIn order to estimate the effectiveness and usability of this architecture, we realized it on two real business cases, a book logistic system and an ERP system; this project comprises five people and they collaborate with each other at different locations while developing system. T hese projects consist of almost 33 tables, and 28,700 lines source code. T he second project is a GLM system, developed using six people at two locations to collaborate in development. The total size of the project comes to almost 100 tables, and 86,500 lines of source code.Table 1. A comparison between Struts and JSPStruts JSP Collaborative development best weakMaintenance best weakReusability best weakThe time of study slow fastTable 1 is a comparison between Struts 1.3.8 and JSP 2.0. Table2is a comparison between Hibernate 3 and JDBC 3.0.Table 2. A comparison between Hibernate 3 and JDBC 3.0Hibernate JDBC Resource cost large smallPerformance fast slow Development fast slow The time of study slow fast5. CONCLUSIONFollowing the processes described in section 4, we used Spring Framework as the infrastructure, used Struts to implement the MVC, and used Hibernate to operate the database. Spring Core controlled the whole software development structure, which could really simplify the management of software hierarchy management.In this paper, we used open source web applications, and improved software quality. At the same time, we used the experience described in this paper to develop a GLM system and combine it with the database of a legacy client-server system. According to the architecture, we also re-engineered a legacy property management system to the web, and successfully extended its software life cycle.Implementing a web application using Spring framework, Struts, and Hibernate need more preparation and planning before development. However, thank to the clear-defined layer, the different objects can follow the same rules; this is helpful especially when development is done collaboratively.Through this method, the system architecture and quality can both be improved. When software engineers develop a large web application system, using this architecture can modularize systems and reduce development cost.6. ACKNOWLEDGMENTSThis research was supported in part by National Science Council, Taiwan R.O.C., under grants no. NSC97-2218-E-164-001, NSC 97-2221-E-164-006, and NSC96-2218-E-035-0027. REFERENCES[1] E. Gamma, R. Helm, R. Johnson, and J. Vlissides, DesignPatterns: Elements of Reusable Object-Oriented Software , pp. 12 - 37, Reading Mass.: Addison-Wesley, 1994. [2] R.E. Johnson and B. Foote, “Designing Reusable Class,”Journal of Object-Oriented Programming , Vol. 1, No. 2, pp. 22-35, June/July 1988. [3] S. Moser and O. Nierstrasz, O. “The Effect of Object-Oriented Frameworks on Developer Productivity,” IEEE Computer , Vol. 29, No.9, pp. 45-51, 1996. [4] B.H.L. Betlem, R.M. van Aggele, J. Bosch, and J.E.Rijnsdorp, An Object-Oriented Framework for Process Operation, Technical Report , Department of Chemical Technology, University of Twente, 1995. [5] M. Mattsson, Object-Oriented Frameworks , LicentiateThesis, Department of Computer Science, Lund University, 1996.[6] S. Sparks, K. Benner, and C. Faris, “Managing Object-Oriented Framework Reuse,” IEEE Computer , 29(9): 52-61,September 1996.[7]M. Mattsson and J. Bosch, “Framework Composition: Problems, Causes and Solutions,” the ProceedingsTechnology of Object-Oriented Languages and Systems , pp. 203-214, 1997.[8] E. E. Jacobsen, B. B. Kristensen, and P. Nowack, “Patternsin the Analysis, Design and Implementation ofFrameworks,” the Proceedings of Proceedings of the 21st International Computer Software and Applications Conference , page 344, 1997. [9] World Wide Web Consortium, , accessed2006/12/1. [10] R. J. Glushko, J. M. Tenenbaum, and B. Meltzer, “An XMLFramework for Agent-based E-commerce”, Communications of the ACM , 42(3): 106-114, March 1999. [11] J. Ding, Y. Huang, and C. W. Chu, “Video DatabaseTechniques and Video-on-Demand”, Handbook of Distributed Multimedia Databases: Techniques and Application , the Idea Group Publishing, USA, 2001. [12] Apache Struts , The Apache Software Foundation,/1.3.9/ userGuide/index.html, accessed 2007/ 7/15. [13] R. Johnson et. al., The Spring Framework - ReferenceDocumentation , Interface21,/docs/reference/index.html, accessed 2007/4/30. [14] The Source for Java Developers , Sun Developer Network,, accessed 2007/8/12. [15] Hibernate , Red Hat Middleware, /,accessed 2007/4/12. [16] Apache Tomcat , The Apache Software Foundation,/, accessed 2007/5/12. [17] K. Beck, E. Gamma, and D. Saff, JUnit 4.1,/index.htm, accessed 2007/3/12. [18] C. Larman, Applying UML and Patterns: An Introduction toObject-Oriented Analysis and Design , Englewood Cliffs NJ: Prentice-Hall International, 1997. [19] C. Alexander, S. Ishikawa, M. Silverstein, M. Jacobson, I.Fiksdahl-King, and S.A. Angel, A Pattern Language . Oxford University Press, New York, 1977. [20] D.J. Chen and T.K. Chen, “An Experimental Study of UsingReusable Software Design Frameworks to Achieve Software Reuse,” Journal of Object-Oriented Programming , 7(2): 56-67, May 1994. [21] R. Johnson, Expert One-on-One J2EE Design andDevelopment , Wrox Press, 2002. [22] R. Johnson, Introduction to the Spring Framework , May2005,/tt/articles/article.tss?l=Spring Framework, accessed 2007/10/2.。

相关主题