【文章內(nèi)容簡介】
els (Model 2, Struts, and JSF) by building three versions of an online store application using each of the three design models, respectively. 1. Introduction Today, Web applications are the most mon applications for presenting dynamic contents. There are a number of technologies for building Web applications, the most popular of which is the Servlet technology . This technology gains its popularity from its superiority over other technologies such as CGI and PHP .Servlets are cumbersome to develop, however, because sending HTML tags requires the programmer to pose them into a String object and send this object to the browser. Also, a minor change to the 畢業(yè)設(shè)計(jì)(論文) 外文文獻(xiàn)翻譯 12 output requires the servlet to be repiled. To address this issue, Sun Microsystems invented JavaServer Pages (JSP) . JSP allows HTML tags to be intertwined with Java code and each page is translated into a servlet. A JSP page is a servlet. However, pilation occurs automatically when the page is first requested. As a result, changing the output does not need repilation. In addition, JSP enables the separation of presentation from the business logic through the use of JavaBeans and custom tag libraries. The norm now in developing Javabased Web applications is to use servlets along with JavaServer Pages. In the later development, there are a number of design models for building servlet/JSP applications: Model 1, Model 2, Struts , and JSF . Model 1 and Model 2 were first mentioned in the early specifications of JSP. Model 1 strictly uses JSP pages, with no servlets, and Model 2 uses the bination of both servlets and JSP pages. The terms of Model 1 and Model 2 have been used ever since. Model 1 is suitable for prototypes and very small applications, and Model 2 is the remended design model for medium sized and large applications. As Model 2 gained more acceptances in the industry, an open source initiative to build the Struts Framework was initiated. Struts perfects Model 2 by providing the controller part of the ModelViewController of Model 2. In addition, Struts provides better page navigation management and several custom tag libraries for more rapid development. Despite its steep learning curve and the fact that it was never defined in any specification, Struts has been gaining popularity as the alternative to Model 2. JavaServer Faces [6] is built under the Java Community Process under JSR127. Sun Microsystems proposed this technology in the hope that JSF will be the ultimate model for building Java Web applications. The most important feature of JSF is the availability of readytouse ponents such as extensible UI ponents, easy page navigation, input validators, data converters and JavaBeans management. The problem facing servlet/JSP programmers are to choose the most appropriate design model. Clearly, JSF provides a better solution in regard to development , some people are not sanguine to adopt this technology for fear of performance penalty due to the overhead of the JSF implementation. 畢業(yè)設(shè)計(jì)(論文) 外文文獻(xiàn)翻譯 13 We build three versions of an online store application named BuyDirect using Model 2, Struts and JSF. The parameters pared are the number of lines of code,the number of classes, and the performance measurement results. We investigate which of the design models allows the most rapid development process. We evaluate the performances of the applications built upon these models. We provide some suggestions to perfect the existing design models to make development more rapid. The rest of the paper is anised as follows. Section 2 discusses the issues in Web development. Section 3 explains how the three design models address these development issues. Section 4 provides the details of the hardware and software used in these experiments. Section 5 presents the experiment results and analysis. Section 6 reviews the related work. Section 7 concludes by offering some suggestions to improve the existing design models. 2. Java Web Development Issues All Java Web development uses the Servlet technology as the underlying technology. As such, all Java Web applications have certain issues that need to be addressed: ? User Interface. The user interface is what the client browser renders as HTML tags. Any serverside ponent used in the application must be encoded into the corresponding HTML elements. Besides for displaying the content and data, the user interface is also responsible in receiving input from the user. ? Input Validation. User input needs to be validated. There are two types of input validation, serverside and clientside. As the name implies, the serverside input validation is performed on the server after the input reaches the server. Clientside input validation is done on the browser, usually by using JavaScript or other scripting languages. The advantages of using clientside input validation are prompt response and reducing the server workload. The serverside input validation should always be performed regardless the presence of clientside validation because there is no guarantee the user browser39。s scripting feature is being on and malicious users can easily work around clientside validation. 畢業(yè)設(shè)計(jì)(論文) 外文文獻(xiàn)翻譯 14 ? Model Objects. Model objects in Javabased Web applications are in the forms of JavaBeans. Model objects make up the Model part of the MVC based design model. A model object can be used to bind a ponent value to be used at a later stage. In addition, it can encapsulate business logic required for processing. ? Page Navigation. Almost all Web applications have multiple pages that the user can navigate from one to another. All MVCbased design m