NOTE: If your company's development environment or project development environment is in a single-language development environment, the framework is not applicable, because one of the frameworks is to develop business modules in multiple languages for a project, and all new projects require the functions of these modules. According to the previous habits, they must be re-developed, at least the business functions developed in other languages are converted into webservice interfaces for new code calls. In this case, the framework discussed in this article can come in handy and eliminate language differences on the client. It only uses pure javascript and html static code for development.
Of course, even in a single language environment, you can still use this model for development, but developers cannot enjoy a variety of excellent server controls (Asp.net controls, controls specially developed for java). Only javascript controls can be used, which is inconvenient for developers (especially those who depend on server controls ).
After talking about the above two blog posts, we found that this model is completely useful. It completely isolates the language of the server from the client, and developers of the client (under theoretical conditions) the language type of the server can be completely ignored, and only Javascript development is performed. The AJAX method provided in JQUERY can be used to communicate with the server method. Blog: (http://www.bkjia.com/a/view/11986.html)
From the overall architecture diagram above, we can see that the client is a WebService interface to obtain and transmit data, and the service-side business model is developed in what language, you do not need to pay attention to it at all (of course, generally, WebService interfaces are best developed in the same language as the service model on the server ).
At this time, we can first think of efficiency issues:
As we all know, the efficiency of WebService interfaces is slow, so it is better to develop websites using this structure model, not only are you familiar with it, but the speed is also good?
Let's look at the following inferences:
1) The efficiency of the WebService interface is slow <---> can the two obtain data asynchronously offset each other?
2) Does the client adopt the Post method to reduce the amount of data and partially offset the slow efficiency of the WebService Interface?
Although we have not completely compared the above two inferences, we can say that they are highly efficient, and WebService is slow, it is not surprising that the page is not waiting for a long time, resulting in a decline in user experience. But is this still possible due to asynchronous acquisition? It should not.
In the transmission process, the Post method is adopted, the data volume is greatly reduced, and asynchronous mode is adopted. The actual running effect should be quite good.
But in some special cases, there are common problems, such as the paging of Table tables, what should we do?
Table data filling and paging, which are very common on pages, pose a threat to the above inferences, the reason is that the paging Code usually returns data to the client memory and then performs paging. Therefore, a large amount of data is transmitted from the server to the client, which will inevitably cause problems, in fact, this problem is not just a problem with this framework. All code that uses this method for paging has this problem, but this framework uses the WebService interface to communicate with the client, the importance of this problem is infinitely magnified.
We will discuss the paging processing in this framework as follows:
Environment: Visual studio 2005
JQuery 1.3.2
SQLServer2005
Paging principle:
We can see that no matter how much data is in the data table, the data returned to the client each time is a one-page data. This method does not adopt the Stored Procedure method, but is processed on the webservice end.
- Three pages in total:
- Previous Page
- 1
- 2
- 3
- Next Page