Use Ajax technology to develop a new generation Web Application 2

Source: Internet
Author: User
   Iii. Potential of networks

The greatness of the internet age lies in the interconnection of all computers around the world, just like in a very large computing resource. Remote and local process calls become difficult to differentiate, and publishers no longer have a clear understanding of what physical machines they are working on.

Unfortunately, remote and local process calls are fundamentally different technologies.

Communication on the network is expensive (they are slow and unreliable ). When a part of non-network code is compiled or interpreted, various methods and functions are encoded as commands stored in the same local memory as the data operated on them (figure 6 ). In this way, passing the data to a method and returning the result is quite direct.


Figure 6 local process call sequence diagram-a few elements such as program logic and data models are stored in local memory and can be seen directly from each other.

In fact, at the underlying layer, many calculations run on the two ends of a network connection to send and receive data (figure 7 ). In fact, this kind of computing is far inferior to running along a physical line, which leads to system slowdown-encoding and decoding at all levels throughout all aspects of communication, from the physical information transmitted along the line, translate the information into values 1 and 0 of the binary, check the error and resend the information, and reintegrate the binary sequence.


Figure 7 A Remote Procedure Call Sequence diagram. The program logic on one machine attempts to operate the data model on another machine.

The request to call a function must be encoded as an object that will be serialized later (that is, converted into a linear byte set ). Then, serialized data is transmitted to the Application Protocol (usually HTTP now) and sent through physical transmission.

On a remote machine, the application protocol is decoded, and the data bytes are deserialized to create a copy of the request object. Then, the object is applied to the data model and a generated response object. To contact the response and call function, the serialization and transport layer must be navigated again, resulting in a response object being returned to the call function.

These clients are complex but suitable for automated implementation. Modern programming environments, such as Java and Microsoft. NET frameworks, provide such functions for free use. Even so, when a Remote Procedure Call (RPC) is generated, a large number of internal activities are in progress, and if such a call is too free, the performance will also be affected.

Therefore, network calls are never as efficient as calling a method in the local memory. Moreover, the network's reliability (and therefore the need to resend the lost information package) also makes this inefficiency constantly changing and difficult to predict. The memory responsiveness on your local machine is not only better, but can be well defined.

But what is the relationship with availability? It has been proved that the relationship is quite large.

A successful computer UI really needs to mimic our real world expectations. One of the most basic principles of this interaction is that it can respond immediately when we click something. The slight latency between the click and response will confuse the user and confuse the user-shift the user's attention from the task at hand to the UI itself.

All the extra work must be done to traverse the network, which often slows down a system so that the latency becomes quite noticeable. In a desktop application, we need to make bad usability design decisions to make the application feel wrong or not responsive, but in a networked application, we don't need to care about this!

Due to the unpredictable potential of the network, This perceptible error may come and go, and testing the responsiveness of the application may become more difficult. Therefore, the potential of the network is the most common cause for poor interaction of real-world applications.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.