Introduction
The Internet has grown at an enormous rate over the past few years, and it has almost certainly affected the lives of most people who use computers. In only a few years, the Internet has evolved from a platform for publishing “online brochures” to an entire architecture for developing dynamic, distributed applications. Developing these applications was previously extremely difficult and tedious.The potential was huge, but the tools consisted of nothing more than text editors in which applications would be coded from scratch. This method of writing Web applications required extensive knowledge of the “plumbing” of the Internet, and there were a very limited number of languages to use. These factors made Web application programming available only to dedicated programmers who had the time to invest in learning rudimentary interfaces and unfamiliar programming languages.
Several projects and products now drastically simplify Web application development by providing easy-to-use object models and familiar, commonly used programming languages. Microsoft has been a leader in this field with its Active Server Pages (ASP) technology. With the latest release, ASP.NET, which is an integral part of the .NET Framework, Microsoft has attempted to build a technology that will be very familiar to the millions of Visual Basic programmers. ASP.NET enables VB programmers to easily apply their Windows application programming skills to Web application programming without alienating existing ASP programmers—rather, it makes Web application development drastically simpler for them, too.
What Are Web Forms?
Web Form simply refers to an ASP.NET page. Microsoft coined the term “Web Form” as it accurately describes the process of ASP.NET page design in Visual Studio .NET. As I’ll discuss later, Microsoft has made the front end, or user interface, design of Web applications almost identical to the methods used traditionally to design Windows application user interfaces in Visual Basic (which are now referred
to as Win Forms applications).
With the advent of ASP.NET we see a shift from traditional scripting to the beginning of full-fledged programming online.VBScript isn’t the only option anymore, as programmers can now employ the full power that lies behind both Visual Basic (VB) and C within their ASP.NET assemblies.</p> <p>There is no denying the widespread acceptance that .NET received from the developer community. It’s proven itself to be a well-developed framework with solid ideas on how the programming world should continue to change.The introduction of a software solution that enables anyone to code in any language that is compatible with the framework is groundbreaking to say the least.
What Is ASP.NET
To fully understand what ASP.NET is, you'll need some background and a brief history of Web application programming. The following sections present a short explanation of server-side programming and a summarized history of server-side programming methods, which should help you greatly in understanding exactly what ASP.NET does and why it's such a groundbreaking technology.
Server-Side Programming
Simply put, server-side programming is programming that is done where the code is executed on a server. With regard to Web application server-side programming, this code is executed when a request is received from a visitor to a Web site, and it generates code that Web browsers understand (HTML) and sends it back to the client (the Web browser)
As you may notice, there's a significant amount of plumbing, or code that's always required in order for the application to run. For example, the application must always return HTML code to the client. Because the Web uses the HTTP protocol, the application must understand these HTTP requests and, equally important, respond using correct HTTP syntax. It is for this reason that several technologies have been developed (and have evolved) to make writing Web applications less tedious and more productive by reducing the amount of plumbing that the programmer is required to perform.
Brief History of Server-Side Programming Technologies
Since the Web began in the early 1990s, the original concept of serving Web pages to users has advanced greatly. In the beginning it was only possible to serve static pages, or pages that couldn't accept user input and change according to user input. However, since then, numerous technologies have been developed to allow dynamic, interactive pages to be served by allowing scripts or programs on the server to generate the pages to be returned to clients for each specific page request.
This has allowed the Web to become much more useful, and it's now possible to perform searches, sign up for services, or buy products through the Web, all of which wasn't possible in the age of static Web pages.
CGI
One of the first technologies to be introduced was the Common Gateway Interface (CGI), which is now built into almost all Web servers. For our purposes, CGI is a method of obtaining and returning information to and from the Web server.
CGI, as its name implies, isn't a language, but rather an interface to the Web server. CGI applications can be programmed in a wide variety of languages. Possibly the most common is Practical Extraction and Report Language (Perl), which is known throughout the UNIX world. Perl is interpreted and therefore not very fast. It is, however, a very powerful language, but with that power comes a difficulty level that is significantly higher than that of Visual Basic. Another common language for CGI programming in the UNIX world is C, which offers several performance advantages over Perl, although Perl is definitely more popular than C for CGI application development. CGI in UNIX is not limited to Perl and C; Python is another popular choice. In fact, it's even possible to program CGI applications in UNIX shell script.
Definite advantages of CGI are that it is platform independent and built into most Web servers. So long as a language with an interpreter with multiple-platform support (such as Perl) is used, CGI scripts will run with little change over multiple platforms, such as UNIX and Windows. In Windows, it's possible to develop CGI executables in a variety of compiled environments, including Visual C++ and Delphi, which can access every part of the operating system.
Possibly the greatest pitfall of CGI from a performance point of view in Windows is that each client request for a CGI "Web page" requires a new process to be created, which consumes vast amounts of system resources should there be multiple requests. From the developer's point of view, CGI applications are hard to maintain and very difficult to debug. They also require the developer to perform a significant amount of plumbing, and CGI does not offer many necessary features exposed by other technologies such as ASP.
ISAPI
Microsoft developed Internet Server Application Programming Interface (ISAPI) for its Internet Information Server (IIS) to eliminate the major performance bottleneck of CGI: the need to create a new process for each client request. ISAPI was intended to replace CGI for IIS by allowing developers to do everything they could by using CGI executables, but do it with significantly less performance overhead. ISAPI applications are compiled as Windows dynamic link libraries (DLLs). ISAPI applications run in the IIS process space, which allows for execution faster than that of CGI applications. There are two different types of ISAPI applications, ISAPI Filters and ISAPI Extensions, each with its own specific use.
ISAPI Filters run in the background and can monitor Web server requests and perform a variety of tasks accordingly. Possibly the most well-known example of an ISAPI Filter is the asp.dll filter, which monitors requests for files with the extension ".asp", processes the file using the variables it has access to on the Web server, and returns the resulting page to IIS to send to the client.
ISAPI Extensions are the rough equivalent of CGI executables and run upon client request. ISAPI Extensions have access to important variables pertaining to the request and are typically used to perform database interaction, business logic, and the like.
IDC
Microsoft's Internet Database Connector (IDC) technology has been included in IIS since its inception and is used to provide easy database connectivity for Web pages. Each page requires two files: a query file and a template file. The query file contains the database connection information and the SQL query. The template file contains HTML and tags denoting where specific data from the query file must be inserted. This method of database connectivity was very easy to use, but it had one major pitfall in that there was no place to put business logic.
ASP
Microsoft combined the best features of IDC and ISAPI to produce Active Server Pages (ASP). ASP pages offer the ease of use of IDC by allowing database and business logic code to be inserted directly into pages using special tags, and they offer the performance advantages of ISAPI. ASP is very scalable, and this has been proven time and time again with many large sites relying on ASP, including Barnesandnoble.com (http://www.bn.com), Fatbrain.com (http://www.fatbrain.com), and Microsoft's huge Web properties (MSN at http://www.msn.com, Microsoft at http://www.microsoft.com, and so on), among many others.
ASP was a huge leap forward and offered a completely new paradigm for dynamic Web page development when it was introduced. ASP's unique approach allowed for dramatic increases in productivity and opened up the exciting area of dynamic Web page development to many novice programmers who were bewildered by the complexity of CGI and ISAPI. This was helped largely by the fact that the primary languages for ASP development are VBScript and JScript, which are very easy to learn and use, especially because VBScript is a subset of the Visual Basic language, and JScript, the Microsoft implementation of JavaScript, is a language commonly used in client-side Web page programming.
ASP's approach spawned a few very similar technologies, most notably JavaServer Pages (JSP). ASP, however, isn't perfect. ASP relies on an interpreted programming model, which affects its performance. A significant amount of plumbing is still required for the programmer to perform in many scenarios for example, controlling user access to an application. Another problem was exposed while ASP programmers attempted to collaborate with graphic and page design teams. Typically, a site's design is not set in stone and graphic design teams will want to revise designs and make modifications during the design and development phase of a site in a corporate environment. If ASP code is used heavily in pages, this can create a number of complications. Most Web design tools do not recognize ASP code and will either rip it out or distort it. If the design teams hand-code their HTML, they may unwittingly remove, replace, or dislocate code on the page. The obvious solution to this problem is to separate the code from the page, but ASP doesn't allow for this. ASP has numerous other shortcomings, and the list in the following section of the major differences between ASP and ASP.NET details some of the problems and Microsoft's solutions to them.
No comments:
Post a Comment