中南民族大学
毕业论文(设计)
英文翻译材料
学院: 计算机科学学院
专业:自动化年级:2011 学生姓名: 胡平学号: 11064089 指导教师姓名: 张宇职称: 讲师
原文摘自:lvar Jacobson.Object-Oriented Software Engineering.第1版.北京:人民邮电出版社,2005.10
外文资料原文
https://www.sodocs.net/doc/1011864584.html, PAGE OBJECT MODEL
Summary: Learn about the eventing model built around https://www.sodocs.net/doc/1011864584.html, Web pages and the various stages that a Web page experiences on its way to HTML. The https://www.sodocs.net/doc/1011864584.html, HTTP run time governs the pipeline of objects that transform the requested URL into a living instance of a page class first, and into plain HTML text next. Discover the events that characterize the lifecycle of a page and how control and page authors can intervene to alter the standard behavior. (6 printed pages) Introduction: Each request for a Microsoft? https://www.sodocs.net/doc/1011864584.html, page that hits Microsoft? Internet Information Services (IIS) is handed over to the https://www.sodocs.net/doc/1011864584.html, HTTP pipeline. The HTTP pipeline is a chain of managed objects that sequentially process the request and make the transition from a URL to plain HTML text happen. The entry point of the HTTP pipeline is the HttpRuntime class. The https://www.sodocs.net/doc/1011864584.html, infrastructure creates one instance of this class per each AppDomain hosted within the worker process (remember that the worker process maintains one distinct AppDomain per each https://www.sodocs.net/doc/1011864584.html, application currently running).
The HttpRuntime class picks up an HttpApplication object from an internal pool and sets it to work on the request. The main task accomplished by the HTTP application manager is finding out the class that will actually handle the request. When the request is for an .aspx resource, the handler is a page handler—namely, an instance of a class that inherits from Page. The association between types of resources and types of handlers is stored in the configuration file of the application. More exactly, the default set of mappings is defined in the
for .aspx resources.
An extension can be associated with a handler class, or more in general, with a handler factory class. In all cases, the HttpApplication object in charge for the request gets an object that implements the IHttpHandler interface. If the association resource/class is resolved in terms of a HTTP handler, then the returned class will implement the interface directly. If the resource is bound to a handler factory, an extra step is necessary. A handler factory class implements the IHttpHandlerFactory interface whose GetHandler method will return an IHttpHandler-based object.
How can the HTTP run time close the circle and process the page request? The IHttpHandler interface features the ProcessRequest method. By calling this method on the object that represents the requested page, the https://www.sodocs.net/doc/1011864584.html, infrastructure starts the process that will generate the output for the browser.
The Real Page Class
The type of the HTTP handler for a particular page depends on the URL. The first time the URL is invoked, a new class is composed and dynamically compiled to an assembly. The source code of the class is the outcome of a parsing process that examines the .aspx sources. The class is defined as part of the namespace ASP and is given a name that mimics the original URL. For example, if the URL endpoint is page.aspx, the name of the class is ASP.Page_aspx. The class name, though, can be programmatically controlled by setting the ClassName attribute in the
@Page directive.
The base class for the HTTP handler is Page. This class defines the minimum set of methods and properties shared by all page handlers. The Page class implements the IHttpHandler interface.
Under a couple of circumstances, the base class for the actual handler is not Page but a different class. This happens, for example, if code-behind is used. Code-behind is a development technique that insulates the code necessary to a page into a separate C# or Microsoft Visual Basic? .NET class. The code of a page is the set of event handlers and helper methods that actually create the behavior of the page. This code can be defined inline using the