A Preview of Active Server Pages+by Wrox Press.
Even though the ink is barely dry on the
documentation for Active Server Pages 3.0, Microsoft is already hard at work on
the next generation of their core server-side
programming technology. In this chapter, we introduce this new product, and look
at what it is all about. Currently called
ASP+ Next Generation Web Services (though this name might
yet change) we'll see why we need a new version of ASP, and explore the concepts
behind its design and implementation. While this book is aimed predominantly
at experienced developers who have used ASP before, we
start out in this chapter by examining some of the core issues involved when you
decide to migrate to ASP+.
ASP+ is designed to be backwards-compatible with earlier versions of ASP, with only
minor changes required in some circumstances (we explore these further in the
appendices). However, more to the point, you can install ASP+ on an existing
Windows 2000 server alongside ASP 3.0. This allows you to experiment with the
new version, without requiring a separate 'test bed' server. You can continue
using existing ASP applications, and migrate them ASP+ when you are ready, so
your investment in ASP is not lost.
But simply porting your applications to
ASP+ will only give you a few of the benefits the new version offers. ASP+ has
many new features that provide far greater ease of use, more power and better
runtime efficiency, but to take advantage of them you will need to
understand more about the way that ASP+ works.
As we are writing this book using a preview
version of ASP+, we can't be exactly sure of all the features of the final
release. But thanks to the information and assistance provided by the ASP+ team
at Microsoft, we can be pretty sure that the content of the book will be
reliable and useful with the final version. We'll also be maintaining a special
Web site that is accessible from
http://www.wrox.com/beta, where we'll document changes as the beta and final
release versions appear, and provide some detailed information as well.
So, in this first chapter, we'll cover:
- How Active Server Pages has evolved since its inception
- What the new runtime framework is
- How ASP+ is different to ASP, and why
- A brief guide to getting started with ASP+
- Some of the changes expected in the final release version
We start with a look at the way that ASP and
ASP+ have evolved, as this will help to set the background for understanding and
working with the new product. For more information about working with COM+ and
previous versions of ASP, check out Professional
ASP 3.0, (ISBN 1-861002-61-0) from Wrox.
Although it seems to have been around forever, Active Server Pages is
only some three-and-a-bit years old. Since its inception in late 1996, it has
grown rapidly to become the major technique for server-side Web programming in the
Windows environment (and on some other platforms using other implementations that
accept the same or similar syntax, such as ChilliASP). But it didn't come from
nowhere – the foundations lie much further back than that.
Dynamic Server-side Web Programming
Traditionally, dynamic Web pages have been created using server-side executable
programs. A standardized Web server interface specification called the
Common Gateway
Interface (CGI) allows an executable program to access all the information
within incoming requests from clients. The program can then generate all the output
required to make up the return page (the HTML, script code, text, etc.), and
send it back to the client via the Web server.
To make the programmer's life easier, and save having to create executable programs,
languages such as Perl use an application that accepts text-based script files. The
programmer simply writes the script, and the Web server executes it using a Perl
interpreter.
Microsoft ISAPI Technologies
Microsoft introduced another Web server interface with their Web server, Internet
Information Server. This is the Internet Server Application Programming
Interface (ISAPI), and differs from the CGI in that it allows compiled code
within a dynamic link library (DLL) to be executed directly by the Web server.
As with the CGI, the code can access all the information in the client request,
and it generates the entire output for the returned page.
Most developments in Microsoft's Web arena have been based on the ISAPI interface.
One early and short-lived product was dbWeb, a data access technology that provided a range
of searching, filtering and formatting capabilities for accessing data stored on the
server, and for interacting with the client.
A second development was the Internet
Database Connector (IDC). This proved a big hit with developers – not only
because it was fast and efficient (unlike dbWeb), but also because it was a lot
more generic and easier to program. IDC introduced the concept of templates, allowing programmers to easily adapt
existing HTML pages to use its features and quickly build new applications around it.
IDC uses two text files for each 'page'. The first is a simple script that defines
the way that the data should be collected from the server-based database. In essence,
it is just a SQL statement plus some configuration information:
{this is the query file named getuserlist.idc}
Datasource: GlobalExampleData
Username: examples
Password: secret
Template: getuserlist.htx
SQLStatement:
+ SELECT DISTINCT UserName
+ FROM Person ORDER BY UserName;
The server executes this file to obtain the results recordset, then loads a template
file:
{this is an extract from the template file named getuserlist.htx}
...
<TABLE>
<TR>
<TD>User name:</TD>
<TD>
<SELECT NAME=selUserName>
<%BeginDetail%>
<OPTION VALUE="<%UserName%>"><%UserName%>
<%EndDetail%>
</SELECT>
</TD>
</TR>
</TABLE>
...
The template is just an ordinary Web page, including HTML, text and other objects,
but with one or more specially delimited placeholders inserted. And the syntax for
these placeholders, and the other simple program code constructs that are supported,
is eerily like ASP. Of course, it was from this that ASP actually evolved:
So, it was in early 1996 that Denali
(the codename for ASP) was released as a beta version 0.9 product, and it took
the Web-development world by storm. The ability to execute code inline within a Web
page was so simple and yet so powerful. With the provision of a series of
components that could perform advanced features, most notably ActiveX Data Objects (ADO), it was almost child's
play to create all kinds of dynamic pages. Even though the ink is barely dry on the
documentation for Active Server Pages 3.0, Microsoft is already hard at work on
the next generation of their core server-side
programming technology. In this chapter, we introduce this new product, and look
at what it is all about. Currently called
ASP+ Next Generation Web Services (though this name might
yet change) we'll see why we need a new version of ASP, and explore the concepts
behind its design and implementation. While this book is aimed predominantly
at experienced developers who have used ASP before, we
start out in this chapter by examining some of the core issues involved when you
decide to migrate to ASP+.
ASP+ is designed to be backwards-compatible with earlier versions of ASP, with only
minor changes required in some circumstances (we explore these further in the
appendices). However, more to the point, you can install ASP+ on an existing
Windows 2000 server alongside ASP 3.0. This allows you to experiment with the
new version, without requiring a separate 'test bed' server. You can continue
using existing ASP applications, and migrate them ASP+ when you are ready, so
your investment in ASP is not lost.
But simply porting your applications to
ASP+ will only give you a few of the benefits the new version offers. ASP+ has
many new features that provide far greater ease of use, more power and better
runtime efficiency, but to take advantage of them you will need to
understand more about the way that ASP+ works.
As we are writing this book using a preview
version of ASP+, we can't be exactly sure of all the features of the final
release. But thanks to the information and assistance provided by the ASP+ team
at Microsoft, we can be pretty sure that the content of the book will be
reliable and useful with the final version. We'll also be maintaining a special
Web site that is accessible from
http://www.wrox.com/beta, where we'll document changes as the beta and final
release versions appear, and provide some detailed information as well.
So, in this first chapter, we'll cover:
- How Active Server Pages has evolved since its inception
- What the new runtime framework is
- How ASP+ is different to ASP, and why
- A brief guide to getting started with ASP+
- Some of the changes expected in the final release version
We start with a look at the way that ASP and
ASP+ have evolved, as this will help to set the background for understanding and
working with the new product. For more information about working with COM+ and
previous versions of ASP, check out Professional
ASP 3.0, (ISBN 1-861002-61-0) from Wrox.
Although it seems to have been around forever, Active Server Pages is
only some three-and-a-bit years old. Since its inception in late 1996, it has
grown rapidly to become the major technique for server-side Web programming in the
Windows environment (and on some other platforms using other implementations that
accept the same or similar syntax, such as ChilliASP). But it didn't come from
nowhere – the foundations lie much further back than that.
Dynamic Server-side Web Programming
Traditionally, dynamic Web pages have been created using server-side executable
programs. A standardized Web server interface specification called the
Common Gateway
Interface (CGI) allows an executable program to access all the information
within incoming requests from clients. The program can then generate all the output
required to make up the return page (the HTML, script code, text, etc.), and
send it back to the client via the Web server.
To make the programmer's life easier, and save having to create executable programs,
languages such as Perl use an application that accepts text-based script files. The
programmer simply writes the script, and the Web server executes it using a Perl
interpreter.
Microsoft ISAPI Technologies
Microsoft introduced another Web server interface with their Web server, Internet
Information Server. This is the Internet Server Application Programming
Interface (ISAPI), and differs from the CGI in that it allows compiled code
within a dynamic link library (DLL) to be executed directly by the Web server.
As with the CGI, the code can access all the information in the client request,
and it generates the entire output for the returned page.
Most developments in Microsoft's Web arena have been based on the ISAPI interface.
One early and short-lived product was dbWeb, a data access technology that provided a range
of searching, filtering and formatting capabilities for accessing data stored on the
server, and for interacting with the client.
A second development was the Internet
Database Connector (IDC). This proved a big hit with developers – not only
because it was fast and efficient (unlike dbWeb), but also because it was a lot
more generic and easier to program. IDC introduced the concept of templates, allowing programmers to easily adapt
existing HTML pages to use its features and quickly build new applications around it.
IDC uses two text files for each 'page'. The first is a simple script that defines
the way that the data should be collected from the server-based database. In essence,
it is just a SQL statement plus some configuration information:
{this is the query file named getuserlist.idc}
Datasource: GlobalExampleData
Username: examples
Password: secret
Template: getuserlist.htx
SQLStatement:
+ SELECT DISTINCT UserName
+ FROM Person ORDER BY UserName;
The server executes this file to obtain the results recordset, then loads a template
file:
{this is an extract from the template file named getuserlist.htx}
...
<TABLE>
<TR>
<TD>User name:</TD>
<TD>
<SELECT NAME=selUserName>
<%BeginDetail%>
<OPTION VALUE="<%UserName%>"><%UserName%>
<%EndDetail%>
</SELECT>
</TD>
</TR>
</TABLE>
...
The template is just an ordinary Web page, including HTML, text and other objects,
but with one or more specially delimited placeholders inserted. And the syntax for
these placeholders, and the other simple program code constructs that are supported,
is eerily like ASP. Of course, it was from this that ASP actually evolved:
So, it was in early 1996 that Denali
(the codename for ASP) was released as a beta version 0.9 product, and it took
the Web-development world by storm. The ability to execute code inline within a Web
page was so simple and yet so powerful. With the provision of a series of
components that could perform advanced features, most notably ActiveX Data Objects (ADO), it was almost child's
play to create all kinds of dynamic pages.
|