The origin of ASP

Source: Internet
Author: User
Tags iis connect new features ole stdin perl script server memory linux

Microsoft's Dynamic Server Web page (Active server pages,asp) technology has now developed to version 3.0. For many people, using ASP to create dynamic Web pages, entire sites, and web-based applications on a Windows Server platform has become an extremely natural approach. In the browser address bar, the file name extension. ASP, like the file name extension. pl or. CGI, which represents a dynamically created Web page, has been accepted by the viewer. In fact, for Web programmers working on Microsoft's operating system, the ASP is becoming a technology that is no longer exciting, but just a way of working.
This change in view reflects the gradual maturation of a technology. As an increasing number of ASP applications, ASP tools are also increasing, while a growing number of third-party developers to develop a series of ASP or ASP-based add-on modules, ActiveX server components, or even a complete set of "do-it-yourself" Web site tools. There is little concern about the peculiar names Microsoft used in the first place. Now ASP in the industry has become a recognized term.
This is a book on the latest version of the ASP mature technology, the purpose is to expect readers to some extent familiar with the composition of the ASP, understand what the ASP can do and how to use it. The purpose of this book is not only to enable readers to start using ASP, but also to enable readers to understand the changes in the ASP's new version and what it can do that earlier versions cannot.
This does not mean that the reader must become an expert to read this book, but wants the reader to understand the basics of web work and scripting language, such as VBScript or JavaScript.
The book will be more from research and technical aspects of the discussion of ASP, so that readers have a better understanding of how the ASP work, to help readers write the ASP code to achieve a higher level. The ASP 3.0 core may not have many changes in nature, but there are many exciting ways to use it.
This section first briefly reviews how the ASP is generated and why the ASP can be popular among Web application developers. Begin by understanding the basics of the web and the development of dynamic Web pages. By comparing ASP with many other technologies that can provide this dynamic, you gain an in-depth understanding of the development of the ASP, while understanding the development of Web applications, not limited to understanding simple dynamic Web sites.
The origin of HTML
The World Wide Web (Wide web,www) originated in the CERN laboratory in Switzerland. Tim Berners-lee and its development team spent a great deal of time studying the creation of a way to transmit information in a certain format, known as Hypertext Transfer Protocol (HTTP, for short). The protocol uses Hypertext Markup Language (HTML). The HTML design is simple and flexible, allowing the display of text and images in Web browsers and other compatible applications. Some parts of a document can be hyperlinks, that is, when selected, you can display different pages or different parts of the same page.
A markup language is a basic element delimited by a particular character, specifying how the text or other entries contained in the base element are displayed. For example <em>this is some emphasized text</em>. HTML is a markup language that is widely based on the standard Universal Markup Language (Standard generalized makeup language,sgml). SGML is a way of describing languages that are not the language used to create Web pages.
The HTML language starts with a simple start, adding additional functionality until the HTML 4.0 version used today is formed. These new features provide a more flexible text font style (for example, < FONT > elements) and more control over the layout of output pages (such as the use of forms and frames).
What the early pages lacked was dynamic content. This is not a problem at first, because HTML is developed to display and transmit information (especially technical and scientific information) between computers, networks, and operating systems. This standardized document is just a simple text and tag in which images and other text-free content are stored as separate files that can be transmitted freely across a variety of networks. In addition, because the format of the information is fixed, the meaning of its constituent elements is also defined in HTML. For a "reader" or browser application, any programming language is relatively easy to implement in any platform or operating system.
As long as these information pages are built, text files and images can be routed to users through Web server applications, and Web server applications simply read them from disk and convert the output to the correct HTTP protocol that can be transmitted over the network. On the customer or client side, the browser receives the transmitted stream and transforms it into a page that can be displayed.
The main advantage of HTML and HTTP, in addition to Cross-platform features, is that its documentation can contain relevant information about the content, the way the author wishes to express, and so on. It can be read by an application and not necessarily displayed: for example, a blind person can use a special program to convert it to speech. Similarly, the content can be displayed in a special way so that people with poor eyesight or other defects are more likely to visit. As a result, the technical community often replaces the "browser" (browser) with the generic term "user agent".
The origin of the dynamic page
For new types of document content, especially those designed to allow you to enter information on a page (such as a form control in HTML < input >, etc.), it is necessary to develop an application that can read and exploit this information. It is clear that the transfer of content from other applications, especially the content of a particular type of database, requires a new approach. Each time you need to rewrite a text-based page, it's certainly not an ideal way to provide a strong real-time message.
For a Web server, it is a common method to provide an interface that enables other applications to connect to it. Through this interface, a custom executable can receive information from the client, including the details of the page request made by clicking the hyperlink or typing a Uniform Resource Locator (URL) in the browser. Instead of reading text or markup files from the server disk, the application's request to the client can generate the corresponding response. Starting with these early approaches, a complete set of methods is developed to dynamically create Web pages in response to changes in user requests or information.
The interfaces used for these applications are still in use and are called Public Gateway Interfaces (Common gatewayinterface,cgi), a standard that can be implemented in any language, such as the C language. It arises from applications that use the Cgi-bin directory (where "bin" represents binary code, not text). Early applications are compiled programs that are usually written in C or C + +. However, this naturally requires that you understand the programming methods of C, and whenever you make small text or markup changes to the program, you must recompile, rebuild the executable file, which limits the use of CGI and dynamic pages.
Instead, you developed a way to create a Web page in scripting language, which is the utility summary and Reporting language (practical extraction and Reporting Language), or Perl, It allows the creator of the information to write code in a language that is very similar to a simplified version of C or C + +. In Perl scripts, you can "write" text and tags, use standard input (stdin) and standard output (STDOUT) functions to communicate with Web servers through CGI, and output to browsers.
Perl is still a popular language on the web, especially on Unix-or Linux-based systems. However, this language is not easy to master, especially for Web developers who do not have a C or C + + language base. Now, some of the new scripting languages appear, making it easier to create pages. Let's take a look at how they make it easier for developers to work.
1. Server-side scripting technology
The server-side script needs to be connected by some type of intermediate application, or by a plug-in program. It must be able to accept user requests, read and interpret the appropriate server-based script files, then create an output page and pass it to the Web server, where it is sent to the client as a response.
In some cases, this task is divided into two sections:
An application or plug-in program handles traffic to and from a Web server (typically through CGI).
Another process interprets and executes scripts.
This is the case in ASP where the script engine is used in the same way as in other environments.
Perl is the first popular server-side scripting language, but now there are many other languages. On UNIX and Linux based systems, a new language called PHP (Personal home Page) is becoming more popular. There are also languages that target certain types of users, such as T C L, a language that simplifies complex mathematical operations in a scientific environment.
2. Microsoft's dynamic page creation technology
Microsoft has launched its Web server Software-internet Information Server (IIS) 1.0 with Windows NT 3.51. This is a fairly standard software that provides a lot of functionality, and it supports CGI. However, Microsoft also provides a different interface, allowing the use of C and C + + and other compiled languages to generate executable files, making the operation more efficient. This is the Internet Server Application programming interface (Internet Servers application programming Interface,isapi). It can provide more than traditional
The more extensive access to Web servers that Perl engines and other technologies rely on for stdin and Stdou T.
Since then, Microsoft and other Third-party developers have introduced many applications that can connect to IIS via ISAPI, which is why ASPs can connect to IIS and other Microsoft server-side dynamic technologies. Prior to ASP, the most widely used Internet Database Connector (Internet databases CONNECTOR,IPC). ASP opens up a new world for Web developers using Microsoft's platform, making it easier to create dynamic Web pages with data from the database. In particular, it introduces a template (template), which contains a template file with text and markup that can be inserted into the query results of a database.
The existing (or outdated) other Microsoft server-side page creation technology has the DB Web and Ole ISAPI. In fact, the DB Web is the implementation of the OLE ISAPI, and for most people, so far it has only proved that the technology is not adaptable in practice. OLE ISAPI is some COM object that communicates with IIS through a special version of the ISAPI interface. The Web server software invokes a single specified function in a COM object and provides details with parameters for the user's request. The COM object returns the text and markup of the page as a string, which is then sent to the client as a response.
OLE ISAPI pioneered the Dynamic Web page creation of COM objects, providing programmers with the ability to create dynamic pages from compiled active Xdll. However, the specific implementation and data communication technologies used by it are less effective and scalable for smaller tasks and intranet (intranets). Also, whenever you change the text and markup of a page, you need to recompile the dynamic link library. Figure 1-1 shows the interrelationship between the technologies discussed so far.

3. Comparison of Dynamic Web page creation methods
Comparing dynamic page creation techniques is a difficult and sensitive task, but it is important to understand the diversity of interfaces and the applications associated with them. When creating an application that interacts with a Web server, the two main issues involved are their impact on the stability of the Web server itself and the efficiency of processing multiple or concurrent page requests. This
The two issues are interconnected and mutually exclusive.
Compiled executable applications (other than DLL files) that apply CGI and ISAPI, usually run out-of-process (out-of-process) on the server computer, which means they are run as separate applications and occupy separate memory spaces from the Web server application. The operating system manages it as a separate process, preventing them from accessing memory other than the memory it occupies.
Therefore, if an out-of-process application fails, it does not affect the Web server. Similarly, if an application contains errors, attempting to write directly to the Web server's memory will stop running because of a general protection error. Out-of-process applications are also aborted by user or operating system commands, and the code is automatically unloaded from memory.
Because running out-of-process programs means that requests to access Web server memory are blocked, the required or resulting output value cannot be delivered directly to the Web server. So you have to perform a cross process call, but it takes more than a few times to access memory in the same process. There is also a certain effect on the loading and unloading times of the executable file.
In contrast, an application-in-process (in-process) program-typically a DLL that can use an ISAPI or OLEAPI interface (not a separate executable), because it runs in the memory space of the Web server, can directly access values in the Web server's memory, which provides faster access and response. However, the error or failure of its code can affect the Web server. For example, the code in the DLL file writes directly to the memory space containing the Web server operation code, which can cause the Web server to fail. The relationship is shown in Figure 1-2.

An out-of-process application instance is a Perl script interpreter and an. exe file that uses the ISAP I interface. Examples of in-process components are Dbweb, IDC, and ASP technology. However, there are a number of ways in which ASP and IIS are interconnected. Therefore, the other related technologies are put aside to further study the ASP.




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.