A good programming model, must have good functionality, reliability, availability, efficiency, maintainability and portability. Java as a programming language, its characteristics meet these requirements, so in the development of Web applications has been widely used. The current most popular Web application servers are also based on Java architecture, such as IBM's WebSphere Application server and Bea's WebLogic application server. Various Java technologies play an important role in other parts of the application server and become the soul of the Web application. How to choose a reasonable programming model, effective use of them, becomes an important link. That arbitrary development although in the initial stage will be very fast, but whether the Top-down or bottom-up development model, will feel more and more do not go on, and development has often become a patch, even if reluctantly completed, will also give future maintenance and upgrades to bring fatal dangers. Perhaps choosing a reasonable programming model in the design phase takes some time and seems to affect the progress of development, but the benefits are obvious.
A Web application is generally divided into browser-side and server-side two parts. Each part also contains different levels. Before introducing this typical programming model, let us understand the various components involved in the programming model, and then integrate them together to illustrate their position and role in the overall programming model as well. This paper also deals with the analysis of the advantages and disadvantages of different technologies in the Web application development process, hoping that these analyses can be used for reference and help to the design and implementation of other development projects.
1. HTML
Hypertext Markup Language (HTML) is a browser-recognized language through which we can allow browsers to display any information they need (text, tables, forms, images, etc.), which is the end result of Web applications. HTML file is a static page, the advantage is that there is no other processing, and can be browser or proxy server cache, so the request for HTML page response time is relatively fast. Another advantage is that it can be easily maintained and modified by a number of Web page editors (such as Pagedesigner, FrontPage, Dreamweaver, etc. in WebSphere Studio) that are generated and edited in WYSIWYG fashion. However, its static characteristics are often not enough to meet the needs, we cannot create a lot of HTML files for a little change. In addition, the HTML specifications supported by different browsers are different, and sometimes the layout of a page in one browser is appropriate, but in another browser it can be a problem like this or that. Sometimes the same function, different browser implementation methods will also be different. In most cases, we use HTML features that are supported by different browsers, and this solution is bound to limit the expressiveness of Web applications and affect the ease with which a feature can be implemented.
2. DHTML
Dynamic hypertext Markup Language (DHTML) is a supplement to HTML. In DHTML, all the elements on an HTML page are treated as objects, and they have their own properties and events. Their control is to change their properties and some events that trigger them. All of these objects together form the Document Object Model (DOM). Information about the DOM can be found at the http://www.w3.org site. DHTML provides a dynamic mechanism for Web applications, which is also handled at the end of the browser, with simple operations such as validation, data validation, and dynamic menus that can be handled directly by JAVASCIRPT on the client without submitting a request to the server. So it can reduce the load of the server to a certain extent, greatly shorten the response time. Like HTML, DHTML is also faced with the problem of not unifying the functionality that is supported by each browser. Often, in order to be compatible with as many browsers as possible, we need to add a lot of judgment and write scripts that implement the same functionality for different browsers. Currently, there are mainly two main types of JavaScript, which are in Netscape's JavaScript (http://developer.netscape.com) and Microsoft IE supported JScript (Microsoft MSDN). Although both are largely compatible, there are obvious differences in many details. Compared to Microsoft's JScript, Netscape's JavaScript provides developers with fewer properties and events than the objects and objects they can control. However, this flaw has been greatly improved in the JavaScript 1.5 supported by Netscape 6.0. In addition, debugging JavaScript is also more difficult, because so far, there is no compatibility and powerful debugger can be used, and the most common debugging methods are limited to print debugging information, the most basic way.
3. XML, DTD, and XSL
Another component is also processed on the browser side, which is XML, DTD, and XSL. In an XML file, we can create our own tags, which is more descriptive of the file. A DTD is a special kind of XML file that defines the legality of the data in an XML file. The XML file can be validated by associating a DTD file. Similarly, an XSL file is a special XML file that records form (stylesheet) information, which is used to map custom tags in XML into various elements of HTML, and different form information can transform the same XML file into different styles. With these features of XML, DTD, and XSL, we can easily change the application look and Feel without changing the entire Web application's components. But there are still very few browsers that really support XML, and it's difficult to debug XSL, so we're still more inclined to use HTML and DHTML.