Problems and Shortcomings

Although ASP is a very powerful technology, it suffers from a number of problems and shortcomings. It lacks separation of client- and server-side code, it does not allow for structured programming, and it does not follow an event-style programming model, among other issues. Luckily, ASP .NET addresses many of these problems and turns ASP into an even more powerful and easy-to-use technology for today’s high-powered web-based applications.

No Events

If you’re a Visual Basic programmer, you are quite familiar with event-based programming. For example, if you drop a button on a form in Visual Basic, then when a user clicks it, it generates a Click event that you can respond to and act on appropriately. In ASP, this type of programming model is nonexistent, even though the same types of events are taking place in your web page–based application. That is, buttons are being clicked, users are entering and leaving fields, and so on. Why shouldn’t you have the capability to answer these events in a similar manner? This is one area in which ASP.NET really shines.

Includes Eat Up Memory

As discussed in the previous section,“includes” are a horribly inefficient way to do something that is inherently very simple. As an ASP programmer, you should be able to link a library of functions into the main application without a detrimental performance hit. Most programming languages allow for dynamically or statically linked libraries that contain commonly called functions directly to the application only once, in the case of static linking, or that allow them to be called from an external binary file in the scenario of dynamic linking.

An excellent example of a bloated include file is the ADOVBS.INC file provided by Microsoft, which defines an ASP interface for ADO. This file is huge, and most people will use only a few items out of the myriad of things it declares. Even though you might use only those very few items, however , the entire page is parsed every single time it is referenced.

In a real programming language, such as Visual Basic or C, you would compile against a library containing pointers for the real versions of the functions in precompiled DLLs. In this way, you are never wasting time accessing any portion of the ADO library that you don’t explicitly request.

Scripted Language Versus Compiled Language

One of the major problems with ASP is that it is a scripted language rather than a compiled language. This involves an enormous and severe performance hit, for a number of reasons.

First, the script parser needs to parse the entire page top to bottom before any of the code can be executed. Second, when the code is parsed, it is not generated into a native machine code that can be executed directly every time thereafter. This process must be repeated every single time that the page is rendered, which is obviously incredibly inefficient.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset