2023年全國(guó)碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁(yè)
已閱讀1頁(yè),還剩23頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、<p>  3690單詞,19100英文字符,5763漢字</p><p>  出處:Kurniawan B, Xue J. A Comparative Study of Web Application Design Models Using the Java Technologies.[J]. Lecture Notes in Computer Science, 2004, 3007:711-721.

2、</p><p><b>  外文文獻(xiàn)資料</b></p><p>  A Comparative Study of Web Application Design Models</p><p>  Using the Java Technologies</p><p>  Kurniawan B, Xue J</p

3、><p>  Abstract. </p><p>  The Servlet technology has been the most widely used technology for building scalable Web applications. In the events, there are four design models for developing Web app

4、lications using the Java technologies: Model 1, Model2, Struts, and JavaServer Faces (JSF). Model 1 employs a series of JSP pages; Model 2 adopts the Model-View-Controller pattern; Struts is a framework employing the Mod

5、el 2 design model; and JSF is a new technology that supports ready-to-use components for rapid Web application</p><p>  1 Introduction</p><p>  Today, Web applications are the most common applic

6、ations 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 ov

7、er other technologies such as CGI and PHP .Servlets are cumbersome to develop, however, because sending HTML tags requires the programmer to compose them into a String object and send this object to the browser. Also, a

8、minor chan</p><p>  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 e

9、arly specifications of JSP. Model 1 strictly uses JSP pages, with no servlets, and Model 2 uses the combination of both servlets and JSP pages. The terms of Model 1 and Model 2 have been used ever since. Model 1 is suita

10、ble for prototypes and very small applications, and Model 2 is the recommended design model f</p><p>  As Model 2 gained more acceptances in the industry, an open source initiative to build the Struts Framew

11、ork was initiated. Struts perfects Model 2 by providing the controller part of the Model-View-Controller of Model 2. In addition, Struts provides better page navigation management and several custom tag libraries for mor

12、e 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 Mode</p><p>  JavaServer Faces is b

13、uilt under the Java Community Process under JSR-127.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 a

14、vailability of ready-to-use components such as extensible UI components, easy page navigation, input validators, data converters and JavaBeans management.</p><p>  The problem facing servlet/JSP programmers

15、are to choose the most appropriate design model. Clearly, JSF provides a better solution in regard to development time. However, some people are not sanguine to adopt this technology for fear of performance penalty due t

16、o the overhead of the JSF implementation.</p><p>  We build three versions of an online store application named BuyDirect using Model 2, Struts and JSF. The parameters compared are the number of lines of cod

17、e, 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 mo

18、dels. We provide some suggestions to perfect the existing design models to make development more rapid. </p><p>  The rest of the paper is organised as follows. Section 2 discusses the issues in Web developm

19、ent. 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 a

20、nalysis. Section 6 reviews the related work. Section 7 concludes by offering some suggestions to improve the existing design models.</p><p>  2 Java Web Development Issues </p><p>  All Java Web

21、 development uses the Servlet technology as the underlying technology. As such, all Java Web applications have certain issues that need to be addressed:</p><p>  User Interface. The user interface is what th

22、e client browser renders as HTML tags. Any server-side component used in the application must be encoded into the corresponding HTML elements. Besides for displaying the content and data, the user interface is also respo

23、nsible in receiving input from the user.</p><p>  Input Validation. User input needs to be validated. There are two types of input validation, server-side and client-side. As the name implies, the server-sid

24、e input validation is performed on the server after the input reaches the server. Client-side input validation is done on the browser, usually by using JavaScript or other scripting languages. The advantages of using cli

25、ent-side input validation are prompt response and reducing the server workload. The server-side input validation should alw</p><p>  Model Objects. Model objects in Java-based Web applications are in the for

26、ms of JavaBeans. Model objects make up the Model part of the MVC based design model. A model object can be used to bind a component value to be used at a later stage. In addition, it can encapsulate business logic requir

27、ed for processing.</p><p>  Page Navigation. Almost all Web applications have multiple pages that the user can navigate from one to another. All MVC-based design models use a servlet as the Controller part.

28、This servlet also acts as the sole entry point to the application. Which page to be displayed after the current request is determined by the value of a specified request parameter. Managing page navigation is critically

29、important.</p><p>  3 Web Application Design Models</p><p>  The Model 2 design model is based on the Model-View-Controller (MVC) design pattern. As explained by Burbeck , there are three main m

30、odules in MVC, the Controller, the View, and the Model. The Controller acts as the central entry point to the application. All user interactions go through this controller. The View contains the presentation part of the

31、application, and the Model stores data or encapsulates business logic of the application. In the later development, the Struts Framework provides a</p><p>  In the following sections, we discuss these three

32、design models and explain how each design model addresses the development issues specified in the previous section.</p><p>  3.1 Model 2</p><p>  A Java Web application that is based on the Mode

33、l 2 design model has one servlet(called the Controller servlet) that serves as the Controller part. All requests are first handled by this servlet, which immediately dispatches the requests to the appropriate views using

34、 RequestDispatcher objects. Views in the Model 2 design model are represented by JSP pages. To store data, a Model 2 application uses JavaBeans, which are the Model part of the application. In addition to storing data, t

35、he JavaBeans</p><p>  3.2 Struts</p><p>  The Struts Framework is an improvement of the Model 2 design model. It provides a default Controller servlet so that the user does not have to write and

36、 compile one. Struts alleviates the task of page navigation by allowing navigation rules to be present in its application configuration file (an XML document). Changes to the navigation rules do not require recompilation

37、 of a Java servlet class. In addition to easier page navigation, Struts provides custom tag libraries that define tags represent</p><p><b>  3.3 JSF</b></p><p>  JSF also employs a c

38、ontroller servlet that is called FacesServlet. This servlet is the only entry point to a JSF application. JSF also uses JSP pages as its views and JavaBeans as its model objects. Unlike Model 2 and Struts, however, JSF p

39、rovides ready-to-use user interface components that can be written on JSP pages. Upon an invocation of a page of a JSF application, the FacesServlet constructs a component tree that represents the JSP page being requeste

40、d. Some of the components can also trigg</p><p>  What distinguishes a JSF application from non-JSF servlet/JSP application is that JSF applications are event-driven. The user interface of a JSF application

41、is one or many JSP pages that host Web components such as forms and input boxes. These components are represented by JSF custom tags and can hold data. A component can be nested inside another, and it is possible to draw

42、 a tree of components. Just as in normal servlet/JSP applications, you use JavaBeans to store the data the user entered.</p><p>  4 Function Environment</p><p>  The software and hardware detail

43、s for our experiments are described below.</p><p>  4.1 The Servlet Container</p><p>  A Java Web application runs in a servlet container, which is the engine that processes the incoming HTTP re

44、quests for the resources in the application. For this research project, we use Tomcat, an open source servlet container from the Apache Software Foundation. The version we use is 6.0.Basically, a servlet container proces

45、ses a servlet by performing the following tasks:</p><p>  - Creating the HttpRequest Object</p><p>  - Creating the HttpResponse Object</p><p>  - Calling the service method of the

46、Servlet interface, passing the HttpRequest and</p><p>  HttpResponse objects.</p><p>  4.2 Testing Clients</p><p>  For performance testing, we emulate multiple users using JMeter 1

47、.9 , also from the Apache Software Foundation. JMeter allows the user to choose the number of threads to perform testing. Each thread emulates a different user. JMeter also lets us choose how many times a test will be do

48、ne. To test a Web application using JMeter, you direct requests to certain IP address, context path, and port number. You can also specify request parameters to be included in each HTTP request. As the output, JMete</

49、p><p>  4.3 Hardware</p><p>  We use different computers for running the applications and for testing, so as to obtain maximum performance measurement accuracy. The computer running the application

50、 is a XP machine having the following hardware specifications: Intel Core 1GHz CPU with 1G RAM. The computer running the testing clients is a Windows 2000 machine running JMeter. The computer has the following specificat

51、ions: Intel Core 1GHz CPU with 1G RAM.</p><p><b>  5 Results</b></p><p>  We obtain experimental results in two categories: the ease of development and performance. The ease of devel

52、opment category compares the number of classes and the number of lines of code. These numbers indicate how easy it is to develop an application by following a certain design model. An application with the fewer number of

53、 classes or the number of lines of code indicates that the application is relatively easier to build. The application with the more number of classes indicates that the app</p><p>  The performance measureme

54、nt results are obtained by comparing two operations. The Search operation is the most common operation in such an application,and the Browse operation.</p><p>  5.1 Ease of Application Development</p>

55、<p>  As Table 1 shows, it takes the most effort to implement the Model 2 design model. Using Struts alleviates the problem a bit, and the best saving in the development comes if one uses JSF. </p><p>

56、  Table 1. The number of classes and the number of lines for the applications under study</p><p>  The Model 2 design model is characterised by the presence of a Controller servlet and a number of JavaBeans

57、classes (as the Model) and JSP pages (as the Views). The Controller servlet is responsible for page navigation rules that employ a series of if statements. Model 2 application programmers must also code for the input val

58、idation that in this research is implemented inside a number of custom tag libraries. The other classes in the Model 2 design model are custom tag library and the tag libra</p><p>  In the Struts application

59、, the Controller servlet is provided by the framework, therefore a Struts programmer saves time for not having to write one. However, he/she still needs to write page navigation rules in the Application Configuration fil

60、e, which is easier than writing a servlet because the Application Configuration file can be edited using a text editor and no compilation is necessary. Input validation must still be done manually, even though the Struts

61、 Framework provides an error handli</p><p>  In JSF input validation comes free through the availability of validator component. As a result, a JSF application developer can skip this task. In addition, page

62、 navigation takes the same course as Struts, i.e. by utilising an Application Configuration file. The other classes in JSF are a ContextListener, an ActionListener, and a Database utility class.</p><p>  5.2

63、 Performance Measurement</p><p>  For each operation, we measure the server response time (in milliseconds) for 1 to 10 concurrent users. The number of users is specified by setting the number of threads in

64、Jmeter. Each test is conducted 10 times and the average is taken. Each operation is discussed further is the following sub-sections.</p><p>  5.2.1 Search Operation</p><p>  The Search operation

65、 whose name or description matches the keyword. There is one SQL SELECT statement performed. Figure 2 compares the three versions of applications for the Search operation.</p><p>  Fig. 2. The performance co

66、mparison for the Search operation</p><p>  For the Model 2 application, the average server response time for one user is 173 ms and for 10 users is 919 ms. For the Struts application, these numbers are 189 m

67、s and 900 ms, respectively. For the application built using JSF, the average server response time is 210 ms for one user and 932 ms for 10 users. The increase of the response time is proportional to the increase of the n

68、umber of concurrent users, which means that the server is still able to cope with the load.</p><p>  The Model 2 application has the least overhead, therefore the average performance should be better than th

69、e Struts and JSF applications. However, the Struts application performs as well as the Model 2 application. This is because the server has enough memory to load all Struts libraries required to run Struts. Also, note tha

70、t page navigation rules in Struts are loaded and stored in an object called ActionMapping. Therefore, given an action request parameter, the next page of navigation is obtain</p><p>  The JSF application per

71、forms slightly worse than the other applications in almost all numbers of concurrent users. This could be due to the time taken by the JSF implementation to construct a component tree for each page requested. However, th

72、e difference in server response time between JSF and other applications is not that significant.</p><p>  5.2.2 Browse Operation</p><p>  The Browse operation,like the Search operation, there is

73、 one SQL SELECT statement performed. Figure 3 gives the test results for this operation.</p><p>  Fig. 3. The performance comparison for the Browse operation</p><p>  On average, the Model 2 app

74、lication performs the best because it has the least overhead. The average server response time is 111 ms for one user and 899 ms for 10 users. The Struts application has comparable performance, with one user average serv

75、er response time of 180 ms and 10 user response time of 920 ms. The JSF lacks a bit behind the two applications with these numbers being 190 and 1009 ms respectively. The increase of the server response time is proportio

76、nal to the increase of the number</p><p>  6 Related Work</p><p>  Compare the performance of database-based Web applications using Java servlets, PHP version 3, and Common Gateway Interface (CG

77、I). After a series of benchmark tests that performs data retrieval from a MySQL database, find that the solution of Java servlets with persistent database connection has the best performance. PHP3 using persistent datab

78、ase connections performs fairly well when compared to the CGI solution,also mention the advantages of using Java servlets. According to these authors. Ja</p><p>  Comparing PHP 4, Java servlets, and Enterpri

79、se JavaBeans. Measure the performance of these three architectures using two applications. Study reveals that PHP4 is more efficient than Java servlets, and the EJBs perform even worse than servlets. However, note that s

80、ervlets, being part of the Java solution, provides the flexibility of being able to be ported to another system with a different operating system. </p><p>  7 Conclusion</p><p>  We find that it

81、 is most rapid to build Web applications using JSF. Model 2 applications are the least rapid but give the best performance. Struts applications sit in the middle of the other two design models in both comparisons. </p

82、><p>  We make some suggestions that could improve the Servlets technology in general and enhance the performance of applications based on both design models.</p><p>  Struts. Struts is not based o

83、n any specification and there is no documentation that discusses its internal working. Therefore, it is hard to know what have been implemented and what could be improved.</p><p>  The Servlets Technology. T

84、he Servlet 2.3 Specification does not define any caching mechanism. There is no mention of caching in the upcoming Servlet 2.4 Specification either. Despite the dynamic nature of the content of a Web application, some co

85、ntents do not change very often. For example, the categories of products that a user can browse in an online store application probably only change once in a month. If those semi-static contents must be generated from th

86、e database every time they are req</p><p>  Model 2.The main drawback is that the page navigation rules are hard-coded in the Controller servlet. This means any minor change to the program flow will require

87、the Controller servlet to be re-compiled. The solution to this problem is to provide a mapper that reads the page navigation rules when the application starts. The code could be conveniently written in the init method of

88、 the Controller servlet. This method is only executed once, i.e. the first time the servlet is loaded into memory. If</p><p>  JSF. JSF provides solutions to common problems in Web development, such as page

89、navigation management, UI components and input validators. However, because this technology is still very young, there are not too many UI components available, forcing programmers to combine JSF with non-JSF servlets/JS

90、P pages. JSF is event-driven. JSF programmers determine the behavior of a JSF application by writing event listeners, just like those listeners in a Swing application. In JSF version 1.0, there are cu</p><p>

91、;  References</p><p> ?。?].Burbeck, S., Applications Programming in Smalltalk-80: How to use Model-View-Controller(MVC),http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html, 1987.</p><p> ?。?

92、].Cecchet, E., Chanda A., Elnikety S., Marguerite J., Zwaenepoel W.: Performance Comparison of Middleware Architectures for Generating Dynamic Web Content. Proceeding of the 4th International Middelware Conference, 2003.

93、</p><p> ?。?].Cecchet, E., Marguerite, J., and Zwaenepoel, W.: Performance and Scalability of EJB Applications. Proceedings of OOPSLA’02, 2002.</p><p> ?。?].Java Servlet 2.3 and JavaServer Pages

94、 1.2 Specification (JSR-053), http://jcp.org/aboutJava/communityprocess/final/jsr053/.</p><p> ?。?].Java Servlet 2.4 Specification (Proposed Final Draft 3),</p><p>  http://jcp.org/aboutJava/com

95、munityprocess/first/jsr154/index3.html.</p><p> ?。?].JavaServer Faces Technology, http://java.sun.com/j2ee/javaserverfaces/.</p><p>  [7]. JBoss EJB server, http://jboss.org.</p><p>

96、; ?。?].JMeter, http://jakarta.apache.org/jmeter/.</p><p> ?。?].JOnAS: Java Open Application Server, http://www.objectweb.org/jonas.</p><p> ?。?0].Sun Microsystems, Comparing Methods for Server-S

97、ide Dynamic Content,http://java.sun.com/products/jsp/jspservlet.html, 2000.</p><p> ?。?1].The Apache Software Foundation, http://www.apache.org.</p><p> ?。?2].The Struts Framework, http://jakart

98、a.apche.org/struts/.</p><p> ?。?3].Wu, A., Wang, H., and Wilkins, D.: Performance Comparison of Alternative Solutions for Web-To-Database Applications. Proceedings of the Southern Conference on Computing, th

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論