The Next Generation Web Services Framework
So, COM+ provides a framework of operating
system services. But that's not the whole story. ASP+ is actually a part of a
brand new runtime framework that provides support
for all kinds of applications in Windows. The framework is a key part of of
Microsoft's Next Generation Web Services or NGWS. When you install
this, you get ASP+ as part of the package. The NGWS framework supports all
other server-side programming techniques as well, such as a new managed
component service, support for building executable applications and Windows
Services, access to performance counter APIs and Event Log APIs, etc.
The NGWS framework extends the Component
Object Model (COM) architecture that we use to create re-usable and interoperable
software components by adding new and enhanced services for scalable distributed
applications:
q
A unified, rich set of programming
libraries
q
A secure, multi-language runtime
engine
q
Simplified application creation,
deployment and maintenance
q
Increased scalability for distributed
applications
q
Protection of existing software and
training investments
We'll look at how it does all these things
next.
What Is the NGWS Framework?
The integration of ASP into the operating
system differs remarkably from earlier versions of ASP, which were basically
just add-ons to the operating system. Up until now, ASP has been implemented
through an ISAPI DLL named asp.dll,
plus a few new system files and the ASP user components that came as part
of the package (such as the Browser Capabilities component).
The NGWS framework reflects the information
technology industry's changing view of the needs for creating, deploying, and
maintaining Web services of all types – ranging from simple client applications
to the most complex distributed architectures. The overall concept and strategy is part of the
Windows Distributed Internet Applications (DNA)
architecture.
However, the important part to recognize is
that the framework is not just there for
ASP+. It acts as a base for all kinds of applications to be built
on Windows. The following diagram shows how the runtime framework supports ASP+
Applications:
The NGWS
framework provides an execution engine to run code, and a family of object
oriented classes/components that can be used to build applications. It also
acts as an interface between applications and the core operating system. You
might ask why we need such a layer, when existing applications can talk to the
core operating system and services quite easily. The reason is that it allows
applications to use the operating system to best advantage, in a standard way
that permits faster and simpler development – something that is increasingly
necessary in today's competitive commercial environment.
To achieve these aims, the runtime
framework implements many of the features that the programmer, or the specific
programming language environment, had to provide themselves. This includes
things like automatic garbage collection, rich libraries of reusable objects to
meet the needs of the most common tasks, and improved security for
applications. This last point, of course, is becoming more important with the
spread of networked applications – especially those that run over the Internet.
A Common Intermediate Language
However, one of the biggest advantages that
the runtime framework provides is a language-neutral execution environment. All
code, irrespective of the source language, is compiled automatically into a standard intermediate language
(IL) – either on command
or when first executed (in the case of ASP+). The runtime framework then
creates the final binary code that makes up the application and executes it.
The compiled IL code is used for each request until the source code is changed,
at which point the cached version is invalidated and discarded.
So, whether you use Visual Basic, C#,
JScript, Perl or any of the other supported languages, the intermediate code
that is created is (or should be) identical. And the caching of the final binary
object code improves efficiency and scalability at runtime as well.
C# is the
new language from Microsoft especially designed for use with the Next
Generation Web Services framework and ASP+. It combines the power and
efficiency of C++ with the simplicity of Visual Basic and JScript.
One thing that
this achieves is the ability to call from one language to another, and even
inherit from objects created in one language and modify them within another
language. For example, you can inherit an object that is written in C# in your
VB program and then add methods or properties, or over-ride existing methods
and properties. In fact, parts of the framework, and the entire ASP+ object
model, are now implemented internally using C# rather than C++.
So, the new runtime framework introduces a
true multi-language platform for programming any kind of application. As most
of our current development is in the area of distributed applications,
especially Internet- and Intranet-based applications, many the new features are
directly aimed at this type of development.
The Web Application Infrastructure
The three sections shown highlighted in
the previous diagram (and repeated in the next diagram) are those that
implement ASP+ itself, and which we're interested in for this book:
|

|
Together, these three sections implement
the Web Application Infrastructure – the topic that we are concerned with in this book. Together with the new runtime
framework, it provides a range of exciting new features:
User Interface Support
As part of the ASP+ libraries, there is a
host of intelligent server-based rich controls for building Web-based user
interfaces quickly and simply. They can output HTML 3.2 code for down-level
browsers, while taking advantage of the runtime libraries for enhanced
interactivity on richer clients such as Internet Explorer 4 and above.
These server-based controls can be also be
reused to build controls composed of other controls, inheriting implementation
and logic from these constituent controls.
Data Access Support
The NGWS
framework provides a new version of ADO, called ADO+, which
offers integrated services for accessing data – regardless of the format or location of that data. ADO+ presents an
object-oriented view of relational data, giving developers quick and easy
access to data derived from distributed sources.
ADO+ also improves support for, and to some extent relies on, XML. ADO+ can automatically persist
and restore recordsets (or datasets as they are
now called) to and from XML. As we'll see, this is particularly useful when
passing data around the Web using ASP+ Web Services.
Scalability for Distributed Applications
Two of the major requirements for any
Web-based application are a robust operating platform, and scalability to allow
large numbers of multiple concurrent requests to be handled. The NGWS runtime
provides these features by allowing automatic error and overload detection to
restart and manage the applications and components that are in use at any one
time. This prevents errant code or memory leaks from soaking up resources and
bringing the server to a halt.
There are also new and updated system and
infrastructure services, including automatic memory management and garbage
collection, automatic persistence and marshaling, and evidenced based security.
Together these features provide for more scalable and reliable resource
allocation and application processing.
Existing Software and Training Investments
Despite all the changes to the core
operating system and runtimes, great care has been taken to maintain backward
compatibility with earlier versions of Windows, COM and ASP. In most cases, existing
applications, COM and COM+ components, ASP pages, and other scripts and
executables work under the NGWS runtime. Alternatively, you can update them in
your own time as your business requirements demand.
All ASP+ pages have the .aspx file extension, and this is mapped to the ASP+ runtime framework.
This allows pages that have the .asp file
extension to run unchanged under the existing ASP runtime.