An Interview with Shelley Powers
by Tara McGoldrick Walsh04/01/1999
ASP (Active Server Pages) is becoming increasingly important as a tool to create browser-independent Web content. It's also being used for an additional reason -- and one that will become more and more important over time, as Web applications replace Web pages -- its extensibility. And the most effective way to extend ASP is to develop custom ASP components.
But how best to go about it? O'Reilly assistant editor Tara McGoldrick asked Shelley Powers, author of Developing ASP Components, a number of questions about the technology that should get you started.
McGoldrick: So Shelley, why write a write book about ASP component development?
Powers: I've always been interested in web server development, and I am interested in working with new technologies. I had worked previously with Microsoft's web server technologies such as dbWeb and ISAPI, but found dbWeb to be limited and ISAPI to be less than friendly. When ASP was originally released and I started my first efforts with it, I was impressed with what I saw, and particularly with how easy it was to add in the use of COM objects.
When I was talking with Ron Petrusha, O'Reilly's Windows and VB editor about doing a book, he mentioned that they were looking for a book on ASP development and I jumped at the chance to work with ASP in general, and with ASP components in particular.
McGoldrick: Tell us a bit about your programming background and how it relates to the subject of your book.
Powers: I've been a software developer for several years and have worked with C++ and Visual Basic in addition to other tools. I have done web server development with Netscape's LiveWire, CGI, and ISAPI and dbWeb. In addition, I also worked with Java, primarily with Java for server development and specifically with Java and the JDBC.
In addition to working with the different tools and languages, I had also worked with COM in its earlier incarnations (OLE) as well as in its more recent implementation, and with CORBA. I am a huge believer in component-based development and can only wonder why it took so long for this type of technology to catch on.
Combine my experience with web development and my familiarity with COM/DCOM and component-based development, and my familiarity with C++, Visual Basic, and Java, and writing a book on Developing ASP components in all three languages kind of "fell out" naturally.
McGoldrick: Where there any parts of this book that you found difficult to write?
Powers: Just as I started to work on the book, Microsoft started one long spree of issuing beta releases of all products involved with the book. This included IIS, MTS, ADO, OLE DB, as well as all three development tools: Visual Basic, Visual C++, and Visual J++. There were even new Service Pack releases of NT!
To add to the writing challenge, the beta products had little or no documentation, particularly the Visual C++ ATL/ASP functionality, including the use of ObjectContext to access the built-in ASP components and the new releases of OLE DB. An additional challenge was the continuing legal hassles Microsoft was having with Sun over Java -- and it's impact on Visual J++.
I managed to survive, however, with the help of the Microsoft beta newsgroups and a couple of folks on the Microsoft beta support team, who were terrific.
It's kind of ironic, but I was beginning to think that all I had to do was write about something and Microsoft would release a new version of the product. You won't think me so paranoid when I say that when I was putting together the support site for the book -- warning, plug ahead -- I added in links to Microsoft web pages to provide additional and supporting information. Well, at the exact same time Microsoft decided to completely revamp their web site. This was the first time in a couple of years that the Microsoft web site was so drastically changed, and the company did this just when I started accessing the URLS for my pages. It goes to show you that just because you're paranoid it doesn't mean someone isn't following you.
McGoldrick: What aspect of writing the book did you particularly enjoy or find important?
Powers: I do like the structure of the book. I think its important to have a good understanding of COM, MTS, and threads before starting to code ASP components, and these are covered in the first section. I think it's important to go into the details of coding a simple component in each of the target languages, which is the first chapter in each language section. I also think that a big part of ASP applications will involve data, and each language section also covers the use of ASP and ADO (or OLE DB with Visual C++).
However, my favorite part was the last chapter in each language section. I called this my "freewheelin'" chapter; this is where I wrote about whatever I wanted. With Visual Basic, this included writing about n-tier applications; with Visual C++, persistence and file access; with Visual J++, the use of J/Direct. I had a lot of fun with these last language chapters.
McGoldrick: It sounds like you enjoyed the writing process then. Tell us what you think are the more difficult problems that programmers face when developing ASP components in Visual Basic?
Powers: Most of the ASP and COM implementation details are hidden with Visual Basic. Even threading is not much of an issue as VB ASP components are apartment-threaded, and thread-safe if you follow good coding practices. However, the biggest problem with VB components is that they are apartment-threaded, which limits their use. For instance, you can't add a VB ASP component to the Application object's Contents collection, since this will generate an error. Even adding an apartment-threaded component to the Session object's collection can lock the Session object down to a single thread and impact on performance.
McGoldrick: Programmers must continually master a mercurial body of information. Over the next few years, how do you see the kinds of information that developers need (and particularly the kinds of information that you've written about in your ASP book) changing?
Powers: We know that Microsoft is releasing new versions of IIS, including IIS 5.0, fairly soon. Microsoft is also releasing Windows 2000. Both of these releases can impact ASP development support and what happens in particular with the built-in ASP components. Considering that ASP is also being ported to other Web servers through the efforts of vendors such as Chili!Soft (and even COM/DCOM is being ported to other operating systems), we all have to be aware that our ASP components may not be working within one specific operating system and on one specific Web server.
Add to this the continuing court cases Microsoft is currently involved with, and we may see more impact on development tools, such as Visual J++, and the development environment, such as IIS.
I think we are going to see a lot more integration of web server applications with other non-web based applications. For instance, we might have C++ ASP components accessing a CORBA server, with transactions managed by MTS.
To meet this, I created the book support site, located at http://www.yasdbooks.com/devaspcomp/, where I will be posting new information as I learn it, as well as changes to code to meet new needs as these needs develop.
I also think its important that ASP developers subscribe to ASP listservers such as those at http://www.asplists.com, and check in with the Microsoft newsgroups to keep up with all the changes.
McGoldrich: If you could ask Microsoft to change just one thing about ASP, what would it be?
Powers: Microsoft, please find a point in the dirt, stick a stick in it, and hang around a while. In other words, start stabilizing your products and consider going a month or two without a new release. However, if you are working on a new release for Visual Basic, can you add in support for both-threading?
McGoldrick: What other subjects, technical or otherwise, have you written about?
Powers: I wrote about JavaScript for The Waite Group Press back when it was first released, and I also did a book on Powerbuilder 5.0 for them. I contributed to Java Unleashed 1.1 and Maximum Java 1.1 for SAMS, and Perl from the Ground Up for McGraw-Hill. I co-authored Web Publishing Unleashed for SAMS, and Using Perl 5 for Web Programming, Special Edition, for Que. I was also the sole author of Dynamic HTML for IDG Books.
McGoldrick: What are your plans for the near future, now that you've finished this book?
Powers: Take some time, smell the flowers, catch a glimpse of Spring, and then get back to work testing the book's code with the new releases of Windows 2000, and IIS 5.0, and Visual Studio Service Pack 2.0, and . . . .

