ASP.NET is the next "version" of ASP. I placed quotes around the word version because ASP.NET is not really a natural evolution from ASP 3.0; rather, ASP.NET offers an entirely new paradigm for creating server-side Web scripts. This article doesn't delve into the details of ASP.NET, rather it touches upon the biggest changes and most profound features. It focuses on how the fundamentals of creating ASP.NET pages differs from creating ASP pages. Finally, the article turns into a bit of an editorial, with my (Scott Mitchell) views on ASP.NET... (If you are interested in learning more about the nuts and bolts of ASP.NET, be sure to check out the great articles in our ASP.NET Article Index!)
In mid-May, 2000 I was invited to a talk on ASP.NET at the Microsoft campus in Washington. This introduction and these views stem from these talks and a number of great ASP.NET articles I've read since Microsoft's official announcement at the PDC.
The .NET Common Language Runtime
Microsoft is in the process of building an entire new low-level infrastructure for Windows. This new infrastructure, when used, sits between the low-level Windows operations and user applications, managing the code execution. This infrastructure, labeled the .NET Common Language Runtime (or CLR for short), provides a level of encapsulation between the developer and the operating system, thereby making writing Windows programs simpler. No longer will the developer have to worry about low-level details such as memory management, pointer management, language differences, and other common annoyances.
The .NET Common Language Runtime is an object-oriented runtime. For example, each datatype in the .NET Common Language Runtime is an object, complete with appropriate methods and properties. Using the .NET Common Language Runtime, developers can no longer use pointers. (This is not an issue with ASP, although this note may raise some eyebrows among Visual C++ developers.) The .NET Common Language Runtime also automatically handles garbage collection. Forget to set an object to Nothing? No big deal! Finally, the .NET Common Language Runtime provides easy access to a number of low-level services vital to an operating system, such as security, authentication, file system access, network information, etc.
|Code written using the .NET Common Language Runtime, is said to be "managed code." Code that does not use this infrastructure is referred to as "unmanaged code."|
An Introduction to ASP.NET
ASP.NET is different from ASP in two major ways: first, ASP.NET offers several programmatic enhancements over ASP. Microsoft really did a great job of listening to ASP developers' comments and ideas for improvements and incorporated those improvements in ASP.NET; second, ASP.NET offers a change in programming fundamentals, in the way you write the code for creating these pages. Chances are you are very comfortable writing ASP pages. Writing ASP.NET pages is an entirely different experience, in my opinion. I'll address both the programmatic enhancements in ASP.NET as well as the changes in the programming fundamentals.
Programmatic Improvements to ASP.NET
Compiled ASP.NET Scripts: ASP.NET offers tremendous performance improvements over ASP. For starters, ASP.NET pages are compiled! No longer are the scripts interpreted and their execution plan cached... ASP.NET pages are literally compiled by a .NET Common Language Runtime-compliant compiler! (.NET Common Language Runtime-compliant compilers include the full line of Visual Studio compilers (VB, VC++, Java, C# (a new language from Microsoft), as well as other compilers written to spec. (there is an .NET Common Language Runtime-compliant Perl compiler, for example).)
Caching: While compiling ASP.NET pages does provide some enhancements to performance, one of the biggest drags on a Web site's performance is with data-access. For example, a Web page that displays a database table will spend the majority of its execution time connecting to the database and querying the information. In an attempt to help unclog this all too common bottleneck, ASP.NET comes with a data-caching module. This data-caching module allows you to specify what data on an ASP page to cache and on what conditions to empty the cache and requery the data-store!
So, if you knew your database was updated rarely, rather than having each request to a particular ASP page requery the database, you could create a page that caches the results for 24 hours. (Or, with a little more work and ingenuity, you could create it so that the cache was invalidated each time the database was updated!)
ADO+, an easier to use ADO: Along with a new ASP, Microsoft has also introduced a new ADO, cleverly named ADO+. ADO+ strives to be a great tool to use for dealing with simple recordsets and accomplished this goal exceptionally. ADO+ treats data in a very loose, n-dimensional, object oriented way. With ADO, all data is represented in two dimensions, rows and columns, but what if a particular row and column entry in a recordset needs to be an entire recordset itself, protruding into a new dimension? This is very difficult to accomplish with ADO and can only be done using data shaping. (To learn more about Data Shaping be sure to read: Data Shaping!)
With ADO+, creating these multi-dimensional recordsets is easier to do. Iterating through, updating, and deleting related recordsets is a cinch. With ADO I think of recordsets as very rigid, two-dimensional slabs of information. With ADO+, I think of recordsets as a squishy, malleable blob of data. Of course such functionality comes at a cost. For database applications requiring transaction-based processing, ADO+ is definitely not the way to go! To learn more about ADO+ be sure to read Microsoft's article: Introducing ADO+.