| With the popularity of Internet, there are two models of network information service: one is the push mode that server initiatively provides information to client-side; the other is the pull mode that is a traditional information mode what clients need to take the initiative in the search for information.Pushlet framework technology is a new application of technology in the development of push technology. The emergence of Pushlet technical framework fundamentally solves the problems about the universal applicability that server informs clients, the frequency of interaction between client and server ,the data redundancy of communication network and the data transmission load of the server in web applications.The traditional interaction between client and server is realized by refreshing web page or doing all content-layout within the applet, so server has a large data transmission load, however, server can have many users'connections.The interaction between client and server achieved by Ajax technology is a pull mode, where an Ajax client sends an asynchronous request through an XMLHttpRequest object to the server, noting that the request is asking a part of the web page contents. Then the Ajax client will update the web page partly with the responding data information from the server. This approach can greatly reduce the data transmission load of the server, and the server has many users'connections. Ajax techonology is mainly applied such as the interaction of form-driven, controlling navigation of deep-seated cascading menu, multi-user interaction, the application that need users simply participating.The interaction between client and server achieved by Pushlet technology is a push mode, where the server directly pushes fresh data from server-side Java objects to client browser.Then the client-side will update the web page partly with the responding data information pushed from the server.The connection between client and server is kept open while fresh data is pushed to the client. The approach achieved by Pushlet technology greatly reduce the data transmission load of the server, however, the server has fewer connections than the previous. Pushlet technology is always used in many areas, such as monitoring, games, user assistance, and multi-user interaction.It may be a good idea combining push mode and pull mode on the interaction between client and server according to the characteristics of Ajax and Pushlet technologies.The overall idea of Pushlet framework is: program a servlet in server-side, and push the generated event object to the client browser through a HTTP connection, and then the information will be dynamicly updated to the web page by client-side.Pushlet pushes events directly from server-side Java objects to client-side without using Java applets or plug-ins. Client browser updates the data transmitted by server to the web page through web development technology without refreshing the page or doing all content-layout within the applet. By now we have arrived on the client-side .The design of Pushlet client framework consists of two parts: The first one is DHTML pattern; the other is Ajax.The design of DHTML pattern is: design a hidden HTML frame on the client-side,which is the network interface between client-side and server-side, andhides in the application web page.Server encodes event objects to lines of JavaScript which are pushed to client-side and executed by the JavaScript engine of client browser,the executed JavaScript codes will call push() method of network interface,then push() method will call _push() method of the application web page and pass its arguments in,finally it is realized updating the information pushed by server to the web page by _push() method.The interaction between client and server is a push mode. The article gives a detailed description on the process of client subscribing and receiving to clarify DHTML client-side framework design.The design of Ajax is: create an XMLHttpRequest object using the XMLHttpRequest core technology of Ajax, what realize asynchronous communication between client and server. The created XMLHttpRequest object will call its response function to manage when server finish transmitting information, what is finally managed to update to the web page.The differences to DHTML pattern are: Ajax client directly uses the XMLHttpRequest object as a communication network interface with server without using hidden HTML frame; the event information transmitted by server using strict XML coding technique; the interaction between client and server is a pull mode, since XML streaming is currently only supported in Moz-family browsers. The article gives a detailed description on the process of client subscribing and receiving to Ajax client-side framework design.Then, the article makes a thorough analysis to Pushlet server technology. Pushlet makes use of a servlet to push an event object generated by server through a HTTP connection, what the event object should be encoded with a coding technology according to the specific client-side, and the data transmittionmode should be appropriate for client-side. At last, client-side would update the event to the web page.The article gives a description in detail about the server framework design for an elaborate of the internal structure and operational mechanism of Pushlet server. It's mainly about the design of the Java classes set, the process of server dealing with client subscriptions and dispatching events. The whole design has a clear thinking, rational structure and expansibility. UML class diagram and the description about the function of main classes on the server intuitively and clearly clarify the static structure of Pushlet server system and the relations between classes; the UML sequence diagrams of handling client subscriptions and dispatching events and related elaborate make it easier to understand the dynamic model, internal operational mechanism and the interaction collaboration between various parts of Pushlet server.Web application development based Pushlet framework includes two things: one thing is to generate information and send messages to the framework; the other is to receive information (usually the browser). Since interfacing may even be done entirely through HTTP, you can develop an application in any programming/scripting language that supports HTTP.Integrating Pushlet in a web application is very easy, besides needing to place those needed files in exactly the same directories, also need make some small changes.Making use of the advantages and characteristics of Pushlet technology to build applications through scripting and to integrate and layout new contents with HTML/CSS features based Pushlet framework, what not only shortens the development cycle of web application and reduce the software cost, but alsoreduces the data transmission load of the server and consumption of network resources. Therefore, Pushlet technology has an important practical value and realistic significance.The changes of foodstuff price all over the country not only reflect the state macro-control, but also relate to the national economy and people's livelihood.So the article gives a detail in simulating and developing an application lively monitoring the foodstuff price all over the country.To meet the needs of future development, Pushlet technology itself also needs to constantly improve and develop, specificly in client-side receiving protocol, client-side sending protocol and subject structure. |