ajax|web| Program
first, the introduction
An ideal user interface is best not visible to users-only when users need them, otherwise they do not interfere in their work and let them focus on the work at hand. However, this is not an easy thing. Today, we become accustomed to doing our daily work through the less satisfying UI until someone shows us a better way.
Now we are beginning to realize how hard our current approach is to do these things.
Because the basic web browser technology used to display the content of the document has been pushed further beyond what it used to be, today's Internet is experiencing this realization.
Ajax (asynchronous Javascript+xml) is a very new name, created for Jesse James Garrett of Adaptive Path. Some parts of Ajax have previously been described as Dynamic HTML and remote scripting.
The advent of Ajax is not just a question of a new name. From a technical and commercial point of view, there is a lot of exciting stuff around Ajax. Technically, Ajax has achieved a great deal of untapped potential in Web browser technology. Commercially, Google and other major businesses are increasingly using AJAX technologies to make the public aware of what a Web application can do.
The typical Web applications we used to use today are under great pressure because the increasingly complex web-based services are maturing and starting to apply to the Internet. New technologies scramble to overcome these problems, and Ajax can better express these ideas using only existing Internet technologies.
With Ajax, we've reused a bunch of old technology but expanded the range of what they were able to do. We need to be able to manage this complexity that we introduce. This article discusses how to implement these technologies, and also discusses the issues of managing large AJAX projects. We'll introduce Ajax design patterns and how they can help us get the job done. Design Patterns help us capture our knowledge and experience, communicate with our current technology and make it available to other objects. By introducing the rules to the code base, they make it easy to create applications that can be modified and extended to work according to changes. Using design patterns for development is even a joy!
Why is Ajax a rich client?
Building a rich client interface is more complicated than designing a Web page. So is something that led us to do this? What are the benefits? What is the rich client?
A rich client has two key features: It is rich, and it is a client.
Let me give you a little explanation. Richness refers to the way the client is. A rich client model-refers to its ability to support various input methods and to respond intuitively and in a timely manner. Although we call it "rich," it must be as good as a modern desktop application like a word processor and a worksheet. Let's look at the implementation techniques that are specific to this goal.
Second, compare user experience
Here, let's discuss an instance of a worksheet program. When I enter a simple formula on a worksheet, I can interact with it in several ways-editing data in the field, navigating the data with the keyboard and mouse, and organizing the data by dragging the mouse.
When I'm manipulating these, the software gives me feedback-the mouse cursor changes, the button highlights when I move the button, the selected text changes color, the highlighted window and dialog box are displayed in different forms, and so on (Figure 1).
Figure 1 This desktop worksheet application illustrates the possibilities for multiple user interactions. |
These are the main features of today's user-rich interactions. Is such a worksheet application a rich client? Not yet.
In a worksheet or similar desktop application, both the logical and data models run in a closed environment-where they are visible to each other, but shut out of the world (Figure 2). My client definition is a program-it can communicate with a different independent process-typically it runs on a server. Traditionally, the server is larger and stronger than the client and stores massive amounts of information. The client allows end users to view and modify this information, and if some customers are connected to the same server, it allows them to share the data. Figure 3 shows a simple diagram of a client/server architecture.
Figure 21 Graphic architecture for a standalone desktop application. |
The application runs in its own process-where the data model and program logic are clearly visible to each other. The second instance of the application running on the same computer has no access to the data model of the first instance, except through the file system. Typically, all program states are stored in a single file-when the application is run it is locked to prevent synchronous exchange of any information.
Figure 3 Client/server systems and N-tier schema diagrams. |
The server provides a shareable data model that customers can interact with. The client still maintains some of its own data models to achieve fast access. Multiple customers can interact with the same server, while resources that are controlled at a good granularity level on a single object or database row are locked. The server can be a single process, like a traditional client/server model earlier in the 90 or a modern model consisting of several middleware layers, external Web services, and so on. In any case, from the customer's point of view, the server has a single entry point and can be considered a black box.
Of course, in a modern n-tier architecture, servers will be able to communicate with back-end servers such as databases-which leads to the emergence of middleware layers-both as clients and as server-side. Typically, our AJAX application is located at one end of the chain-only as a client, so we may think of the entire N-tier system as a single black box-we mark it as a server for our current discussion.
My worksheet focuses only on its own data stored in local memory and on local file systems. If it is well structured, the coupling between the data layer and the description layer may be fairly loose, but I can't break it down and share it over the network. So, from our description level goal, it's not a client.
Of course, a Web browser is a client that connects to a Web server and makes page requests from it. These browsers have a wealth of features to manage users ' web browsing, such as Back buttons, history lists, and multiple-page storage documents. But if we treat a Web page of a particular site as an application, then these generic browser controls can no longer be associated with the application, just as the Windows Start menu or window list is related to my worksheet.
Let's look at a modern web application. Mainly because everyone may have heard of it, we will select amazon-online booksellers For example (Figure 4). Now I'm pointing my browser to the Amazon site, because the site remembers who I was from my last visit, so it shows me a friendly greeting, a list of referrals, and historical information about the books I've purchased.
Figure 4 Amazon.com home page. The system remembers my previous visit to the site, where navigable links are a mixture of generic and private information. |
Clicking a title from the list of suggestions will lead me to a separate page (i.e., the screen flashes, so I lose the list that I can see a few minutes ago). The new page will then be full of contextual information (see Figure 5).
Figure 5 Amazon.com site book details page. |
Again, a large number of hyperlinks appear with generic and private information. However, a great deal of detail is the same as shown in Figure 4-this, due to the document-based operation of the Web browser, must be forwarded back to each page.
In short, I have shown you a very rich and closely related information. And the only way I can interact with this information is by clicking the hyperlink and filling out the text form. If I fall asleep while browsing the site and wake up the next day, I won't know that the new Harry Potter book has been released until I refresh all the pages. I can't go from one page to another with my list, and I can't zoom in on a part of the document to see multiple content at once.
This is not to denigrate Amazon, which works pretty well in very limited limits. However, the interaction model on which it relies is undoubtedly rather limited than the worksheet.
So why are there so many restrictions in modern web applications? At present, there are many technical reasons. So now let's make a further analysis.
[1] [2] [3] [4] Next page