Product Description
From the Inside Flap
The Active Server Pages (ASP) runtime was designed to provide an easy way to create dynamically generated HTTP response packets. On this count, the designers of ASP get an A.
Most of the day-to-day use of ASP is also this easy. Many times, developers feel the need to push the envelope of what a particular technology was designed to do. Whether just for fun or based upon a real application requirement, pushing that envelope can be frustrating. In order to push the envelope with ASP, you need to understand how it works, how each piece is put together.
If you are interested in learning what ASP is or how to program ASP in general, this is not the book for you. You should read this book once you have a solid understanding of ASP programming in general. This book is meant to peel back the cover on ASP and look inside. I will peer into the plumbing and show how ASP does what it does. My goal is that, after reading this book, you will be a better ASP and COM programmer by understanding how the pieces fit together, not because I showed you the best way to write a loop in VBScript.
It would be helpful to us as developers to have the source code for ASP, even if only to help us debug our own code. Until Microsoft completely embraces the Open Source movement (don't hold your breath), we have no real way of knowing what the internals of ASP really look like. I can guess based on what I know about how ASP works. In this book, I will implement a "clone" of ASP. I have decided to name this clone "Active COM Pages" (or "ACP" for short). Instead of showing you the source code of ASP, I will show you the source code of ACP. ACP in most ways will behave exactly as ASP does (and when it doesn't or can't, I will point that out).
A few caveats about my implementation. First, it does not act like ASP in all ways. It isn't meant to be a replacement for ASP, only a reference to help understand ASP itself. Second, the ACP implementation isn't production code that I recommend using in a real system. Again, it is the bare minimum needed to replicate the important functionality of ASP.
I hope that seeing what ASP does under the covers (approximately, at least) will help you better understand how to put together your own ASP applications. Intended Audience
This book is written for anyone who wants to know more about the internal workings of ASP (hence the title). You should be a seasoned ASP developer who has a firm grasp of COM (Microsoft's Component Object Model). (For two good books on COM, see Don Box, Essential COM, Addison-Wesley, 1998, and Ted Pattison, Programming Distributed Applications with COM+ and Microsoft Visual Basic 6.0, Microsoft Press, 2000.)
All of the ASP code in this book is written in VBScript. The code implementing ACP (my ASP clone) uses C++ (including some classes from the Standard Template Library-STL). This is necessary because of the underlying architecture. ATL (Microsoft's Active Template Library) is used to implement the COM classes used inside of ACP. Even if you are not familiar with C++ or ATL, the code comments and explanations will help you understand how ASP works. What to Expect
Each chapter of this book covers a particular aspect of the ASP runtime. Chapter 1, "Introduction," provides an introduction to the Hypertext Transfer Protocol (HTTP). In the end, everything in ASP is translated to and from HTTP. This chapter includes a brief description of how HTTP works.
Chapter 2, "IIS and ISAPI," explains how IIS (Internet Information Server, which hosts ASP) is put together and how ASP uses ISAPI (Internet Server Application Programming Interface) to do the majority of its work.
Chapter 3, "Active Scripting," focuses on hosting the Active Script Engine interfaces, which ASP uses to do the majority of its heavy lifting, and on adding named objects to running scripts.
Chapter 4, "Wrapping HTTP," discusses ASP's IResponse and IRequest interfaces and how they interact with the HTTP protocol through ISAPI.
ASP provides built-in state management at both the session and application level. Chapter 5, "State Management," discusses the interfaces used to provide state management and how to avoid performance problems that can arise if the interfaces are not used judiciously.
ASP's and the scripting engines' integration with COM is one of the best features of the runtime. How COM objects are created and how they interact with ASP are the subjects of Chapter 6, "IServer and Components."
ASP also integrates with the COM+ transactional services. Chapter 7, "Transactions," shows how ASP achieves this integration.
The Internet has made global distributed applications a reality. ASP has built-in features that enable you to write internationalized applications as Chapter 8, "Internationalization," will show. Jon Flanders
September 2000
0201616181P04062001


