CHAPTER 10 (Web hosting plans) INFINITE DATA PATTERN In the

CHAPTER 10 INFINITE DATA PATTERN In the action boxes Server receives XML and XML is converted into task, the client-side structure is converted into data that is associated with a task. When the data is associated with the task, multiple tasks may process a single piece of data. More about multiple tasks and the data will be covered shortly. After the conversion action box is another black bar that indicates an execution of parallel task paths, where one path causes a thread to be spun off to start a task. The other patch represents the original thread, which is finished, as there are no further actions. The main reason for the execution of tasks is to start the thread(s) used to process the task(s). When the spun-off task executes, a result could be generated that is added to the result database, as indicated by the actions Task is processed and Result is marked as available. The diamond shape on the left side of Figure 10-1 represents a decision and the joining of server-side with client-side actions. What happens is that the client-side route is querying the server as defined by the action items Query serverand Query for available result. If there is a result available, the server converts the result into an XML content chunk that is sent to the client for processing. The action items Client receives XML, XML is parsed and converted into state, and State is processed represent the receiving and processing of the XML content chunk to generate some result. The action items of Figure 10-1 form a big-picture perspective showing a client-generated structure that is converted into data that is associated with a task that generates another result structure that is processed by the client. There is a disjoint in that the client has two parallel tasks running, and this means the logic used to send the structure is not the logic used to receive the result structure. In a nutshell, the left hand has no idea what the right hand is doing. The problem relates to two queries running on behalf of a single client. When the client receives a result, how does the client know which query the result belongs to? Putting this practically, imagine an HTML page with two text boxes. Each text box represents an instance of the same task, but different task data. Each text box starts the same task, resulting in two task instances executing with different data. The problems begin when the client retrieves a result. The receiving algorithm does not know which text box a result belongs to. The solution for the identification problem is to use a transaction identifier. In the activity diagram, the concept of the transaction identifier is not illustrated. It is not illustrated because the transaction identifier is a piece of information in the generated structure. The transaction identifier is generated by the client, sent to the server, sent to the executing task, and sent to any generated result. Then when the client receives a result, the client can associate the sent transaction identifier with a received transaction identifier. Thus the client can decipher which text box a result is destined for. From the perspective of the server, the transaction identifier is a black box and not processed. Combining the actions, activity diagram, and other details, the implementation of the Infinite Data pattern involves three major pieces: HTML client, task manager, and task implementation. The HTML client is used to send and receive the structures. The task manager is responsible for creating the task data, managing the tasks, and managing the results. The task implementation is the application logic, which in the case of this chapter is the prime number calculation and is responsible for the task data association and results generation. Implementation The Infinite Data pattern implementation in this chapter will be a simple example of calculating all prime numbers up to a specified value. So if the specified value were 9, all the prime numbers up to the number 9 would be 2, 3, 5, and 7. This simple algorithm is useful because it allows us
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Leave a Reply