CHAPTER 10 INFINITE DATA PATTERN Persistent Communications (Web server application)
CHAPTER 10 INFINITE DATA PATTERN Persistent Communications pattern is used because it is able to receive data asynchronously, which is a fundamental aspect of the Infinite Data pattern. The Infinite Data pattern is not related to any operations that define the basis of an HTML page. The Infinite Data pattern is not intended to be used as a replacement for the Content Chunking pattern, because the HTML content retrieved by the Content Chunking pattern is not processed. It is inserted into the HTML page. The results retrieved from the Infinite Data pattern are processed and transformed into content that is added to an HTML page. Architecture The nutshell description of the Infinite Data pattern is the building of a result set incrementally. Therefore, when implementing the Infinite Data pattern, the task executed must be able to generate results as the further results are being generated. When generating a result set, don t think of having to generate an individual result that is sent to the client immediately. It is acceptable to generate a set of results that are sent in batches to the client. Think of how search engines function. You create a query and are presented with an HTML page that probably contains a dozen results. To get the next dozen, another HTML page is loaded. The results are sent to you in batches. Some readers may say that with a database query it is not possible to generate a subset of results. A query generates a result set that is iterated. The argument is that the query that might take a long time cannot be subdivided into smaller queries. This is not entirely correct, as recently many databases and programming platforms such as .NET and Java have introduced APIs to execute asynchronous requests on a database. The asynchronous APIs will not be discussed because they are beyond the scope of this book. This chapter, though, does provide enough information on how the asynchronous APIs could be used. The aim of the Infinite Data pattern from the perspective of the client side is to send a task to the server, return control to the client, and then wait for the results to arrive from the server. From the server perspective, the Infinite Data pattern needs to implement the details of the Persistent Communications pattern. This means the server side has to implement concurrent programming techniques because requests and results are asynchronous of each other. The details of the Persistent Communications pattern require the implementation of threads, processes, or even an additional application server (for example, Java J2EE application server, COM+, or Zope). From an architectural perspective, an Infinite Data pattern implementation requires the execution of the following actions, which are not in sequential order: The client and server use the Persistent Communications pattern, which is responsible for sending and receiving data. The client creates a structure that contains the actions to be executed on the server. The server parses the actions and creates a task that is executed. The executed tasks process the information and if necessary generate a result(s). The client queries the server for a result. If a result is retrieved, it is processed on the client side. The actions, converted into a UML activity diagram, are illustrated in Figure 10-1.
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.