Learning programming language, mastering the object-oriented programming idea is particularly important, once understood the object-oriented concept, then many places to get life to understand, it is much easier.
The dry and dry language of books, for many people, that is difficult to understand, more difficult to remember long time. But the programming language is for the life service, also originates from the life. Our life is rich and colorful, so it is much easier to use examples of life to understand programming.
Below, we use the example of a phone call in life to understand the internal process of the ASP. NET Runtime:
When the request arrives at IIS, IIS passes the request to the ASP. NET runtime environment, which is processed in the ASP. Aspnet_isapi.dll, and the final processing results are returned to IIS and sent to the client.
The ASP. Process requests are done through a series of objects:
HttpApplication: by using an instance of the HttpApplication class to handle the many requests received, it can only process one request at a time.
Life Example: the equivalent of mobile network operators to receive all calls to our mobile phone number requests, but it can only send you a phone request at a time, if there are two or more requests at the same time, you need to wait for the first request to end before you can send a second request.
HttpModule: filtering the HTTP request. It can add some additional work that requires information in this HTTP request, or for intercepted request information, or in some cases simply terminates HTTP requests that meet some conditions. After HttpModule filtering, pass the appropriate HTTP request to the Real Processing Center (HttpHandler).
Life Example: the equivalent of mobile phones, we through the settings of the phone, you can set the call firewall, block blacklist to point, you can also set the number of contact name, Avatar and personality ringtones and so on. Then call the firewall to release the calls through the form of personalized delivery to us.
HttpHandler: is the real Processing center for HTTP requests. After the HTTP request has been processed, it sends a response via HttpApplication.
Life Example: the equivalent of a person, incoming calls through the firewall filtering, in the format of the notification of mobile phone holders, mobile phone holders to answer the phone, and will reply to the voice through the mobile network operators to call callers.
Of course, it's not great to just understand the process, but it will be able to quickly understand what we're going to do and where to start when we implement some of the relevant functions later. It is no longer "what I want to do, what technology to use".
Understanding the ASP. NET runtime with a live instance