Context in the computer

Source: Internet
Author: User

Context, which refers to an environment.

In software engineering, context is an ordered sequence of attributes that define an environment for objects residing within the environment. The context is created during the activation of the object, and the object is configured to require certain automated services such as synchronization, transactions, real-time activation, security, and so on. As in computer technology, the context is the process execution environment relative to the process. Specifically, the variables and data, including all the register variables, process open files, memory information, and so on.

HttpContext

Its interior consists mainly of two members, one is request, and one is response (response). After it is generated by httpruntime, it is passed into the HttpApplication. Then execute the HttpApplication processrequest () method. Enter more than 20 pipeline events and finally return the contents of the server response to the browser.

A context is a class that encapsulates information about each user session, the current HTTP request, the requested page, and so on.

This makes instances of these classes available as internal objects that are accessed from code. The following is the inner object of the context and the class that generated the instances.

reponse: provides access to the output stream of the current page. You can use this class to insert text into a page, write a cookie, and so on.

Request : provides access to the current page requests, including request headers, cookies, client certificates, query strings, and so on. You can use this class to read what the browser has already sent.

Context: provides access to the entire current context, including the request object. You can use this type of information between shared pages.

Server: exposes a tool method that you can use to transfer controls between pages, get messages about the latest errors, encode and decode HTML text, and so on.

Application: provides access to methods and events for all sessions within an application scope. It also provides application-wide access to the cache of information available for storage.

Session : provides information for the current user session. It also provides a session-wide cache access for storing information, and a way to control how the session is managed.

Trace: provides a way to display system and custom trace diagnostic messages in the HTTP page output.

The context should be a variety of resources used by the program to run, when multiple programs run, the system will allocate time for each program, the program is not completed within the specified time (slice), the system should save its context, so that the next time (slice) come when the original running state of the program can be quickly restored. It should be a static object for a program or a child thread.

Context in the computer

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.