Asp. NET Extraordinary Code control (ii)

Source: Internet
Author: User
Tags file system backup
Crystal Translation Yesky


Optimize and buffer storage. How did this happen?

Based on the first request of the script, runtime compiles the code and caches the results of the compilation (backup). Anytime, as long as the script
Please, the stored copy can be used. This result greatly enhances system performance because, after the first request, the code can run faster from the compiled version.

Someone might ask, "How does it know when I made a change?" Microsoft has already answered the question. Runtime to monitor source files through the file system.
When the initial source file changes, it automatically drags the compiled version out of the cache backup, so that when the next requirement comes in, it (the compiled file) is again
Compile. This means that the system compiles the code automatically and the programmer will no longer have to worry about compiling it manually.

Caching

For most system developers, they must develop "caching" to speed up the system. Whether an ASP page is exported to an HTML file
, the speed of network connection is very slow. Or from a slow internet link reference, to the status of the recordset and the email representation on the roaming form, or even a
The database dynamic driver menu is not really a dynamic drive, and you can't waste a lot of time on each client request. When you create a Web site, in general,
Small amounts of data do not continue to change, but because they are not really dynamic and do not mean to complicate the code, where are they? So, you
Have to develop some caching

The basic caching activity is to first select the appropriate data for storage. Then you need to place them in the application level variable in the program. and
After identifying the code. Then you have to decide how long to store the data and write the program so that you can empty the caching in time. But if you empty the caching
, the program you use should have the ability to restore the data again.

The caching system was established in the ASP.net. Make the whole system more object-oriented than before, so that the caching system can also store objects. Because
This, whenever caching, can also be invoked at any time. You can set the time of the data store as needed to decide to create various types of environments. Through the document department
You can even link a detailed project to a file so that when the file changes, the linked items are stored at the same time.

Also not limited to this, ASP. NET also stores output data. For ASP. NET script result to make a backup, so when someone calls it, he doesn't even have to ship
row, the correct output is already in the send. It is mainly based on the query string to work, if the parameters can not match the parameters in the store, the record parameters of the
The page will rotate to the storage version

Sometimes it's a bit tricky to decide what needs to be stored based on the site, but not at the moment.

Faster and simpler development

Any development platform will provide you with a solid state of the environment. In the ASP, although the performance of this environment is good, but in fact it is useless. But through
asp.net, this environment is ready for you before you write your first line of code. The programmer had to do a good job in order to design a perfect program
This is the environment that has been done for you now.

Object-oriented model

When your code is running faster than ever before, you've got a real event model and you can control it. In the past,
If you want a program to run earlier, you have to put the program in front of the page, instead, on the back of the page. This method often does not play a
Very important, so you have to build your code in a variety of ways to get the desired results. This "spaghett-code" problem can be achieved by using a large number
of events to fix, such as Page_Load

Each page-level object has its own event model and has the ability to activate the Designed server event. Similar to Button_Click or
Listbox_change's routine is the ability to make standard form processing and to handle a large number of relatively simple day-to-day tasks on your behalf. Reading code is also possible,
This means that even if a program has a problem after six months, you can find your previous settings and debug them in time.




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.