MSDN Interview
June 1998
One of the key new features in Microsoft Visual Basic® 6.0 is its ability to allow developers to insert new items called WebClasses into their projects. For an explanation of WebClasses and how they fit into Visual Basic 6.0, MSDN's John Swenson interviewed David Stutz, Microsoft's chief architect for Visual Basic and a frequent presenter at conferences such as the recent Tech·Ed 98. Stutz, who prefers to describe himself as an "architectural wonk," describes how Microsoft is moving Visual Basic in the direction of distributed computing and the Web.
MSDN: I'm here to interview you today for MSDN. We'd like to focus on the new WebClass feature in Visual Basic 6.0. First of all, can you explain what WebClasses are and what they mean to the Visual Basic developer?
Stutz: WebClasses are a new concept for the Visual Basic programmer. In Visual Basic 6.0, we're introducing a way to create server-side applications that are hosted by Internet Information Server (IIS) and can be viewed on the client using a Web browser. Since we think developers will want almost every application they build in the future to have at least partial exposure via Web browsers, we wanted to make this as easy as using Visual Basic forms.
MSDN: I understand that WebClasses allow Visual Basic developers to separate their application logic from their user interface. Can you explain this?
Stutz: Yes, WebClasses do allow the programmer to separate the logic behind their application from the presentation of the application. One of the things that the Web emphasizes is that separating the components of an application into logic, presentation style, navigational structure, and content or state is super important.
We've had support for this kind of separation in Visual Basic for a long time, and we've talked about building multitier applications, but the Web metaphor has made it more prevalent. As people start to build distributed applications, this style will become more and more important.
MSDN: When a developer opens Visual Basic 6.0 for the first time, what exactly will they find that's related to WebClasses?
Stutz: When you start Visual Basic 6.0, you can still, of course, do all the things that you've done in Visual Basic before. But now you can also insert into your project an item called a WebClass. A WebClass represents code that can run on an Internet server. Essentially, it's the ability to put code behind URLs.
MSDN: I understand there's a new tool called WebClass Designer. Why did you feel it was necessary to build this tool, and what does it look like?
Stutz: We really think that in the future, every application will have a Web component and will deliver part of its functionality through Web browsers. Even standalone applications might choose to use DHTML (Dynamic HTML), for instance, as a UI.
Because of that, it's important to make using server-side code as easy as using a database is in Visual Basic today. The WebClass Designer is very simple. It has a tree view that represents the various pages or entry points on the IIS server. The programming namespace behind those entry points is populated with the same objects that developers use when they program against ASP (Active Server Pages).
As a result, there's very good fidelity between WebClass programming and ASP programming. You use the same Request object, the same Response object, and the same Server object. This commonality between the two will make WebClass programming very easy for people who are used to ASP programming.
To move developers to the world of programming WebClasses, it was very important for us to make programming Internet servers as easy as it is to program Visual Basic forms today. We wanted to have something that would allow Visual Basic programmers who aren't necessarily familiar with HTTP to get up and running very quickly against HTTP servers.
MSDN: Is it possible to use Visual Basic 5.0 today to accomplish what developers will be able to do with WebClasses in Visual Basic 6.0?
Stutz: People using Visual Basic 5.0 today do write server-side applications that they deliver through IIS, but it is much easier to do this using the WebClass Designer in Visual Basic 6.0. Today what people do, typically, is call their VB-built COM components from within .asp files. They write some script, they write components, and they call those components from the script.
With the WebClass Designer, people can go straight into Visual Basic 6.0, add a WebClass for their project, drop into the IDE, write some code, hit F5 and debug that code. They don't ever have to drop out, write ASP script code, go to a different debugger, that kind of thing. It's a much more integrated experience.
MSDN: You've talked a lot in the past about DHTML, and given presentations on using DHTML with Visual Basic 5.0. Can you talk a little bit more about DHTML and how that relates to WebClasses?
Stutz: You can use DHTML as a richer front-end to WebClasses. DHTML uses HTTP as its mechanism for communicating with the Web server. Web classes are a way to put code behind HTTP.
MSDN: How would you characterize the relationship between WebClasses and other Microsoft Web-related development tools, such as Visual InterDev™ 6.0 and FrontPage® 98?
Stutz: There are two pieces to Web programming. One is programming the HTML or DHTML that goes down to the client. The other is programming the server. At Microsoft, we have several very good HTML editors, and many of our productivity applications can also produce HTML. We didn't want to make Visual Basic yet another HTML editor in the business of doing visual HTML design.
Instead, we chose to make Visual Basic 6.0 seamlessly interoperate with Microsoft's other HTML editors. People can use FrontPage or Visual InterDev to create their Web pages. Then they can import those Web pages directly into the WebClass Designer in Visual Basic 6.0 and use it to write code behind the points in the Web pages that access the server.
In addition, tools like FrontPage and Visual InterDev are very good at managing and building an entire site, while Visual Basic is much more about building applications that can include Web client access as one part of what they do.
MSDN: So there is some integration between Visual InterDev 6.0 and Visual Basic 6.0?
Stutz: Absolutely. They work very well together. Visual InterDev is a great tool for building entire Web sites, as well as pages in a site that have script in them or consist of pure content—HTML and DHTML pages. Visual Basic is, of course, a great tool for writing Visual Basic code, and is good at all types of integration.
The kinds of integration I'm referring to are talking to databases, which is something that Visual Basic does exceptionally well, or accessing COM components and COM-based services such as MSMQ (Microsoft Message Queue Server).
We anticipate that developers will write this kind of code in Visual Basic and integrate it into the Web sites that they create using Visual InterDev. Visual Basic and Visual InterDev are complementary parts of Visual Studio, and I expect most Visual Studio customers to use them both.
MSDN: Where do WebClasses fit into Microsoft's Windows DNA platform?
Stutz: DNA is a roadmap for building three-tier applications. The top tier is essentially presentation, UI presentation. Two interesting kinds of presentation are HTML and Win32. You can mix and match between them. You can embed HTML within a Win32-style UI or you can embed Win32 controls within an HTML page. Both generic HTML 3.2 and the richer client experience of DHTML are interesting.
The middle tier is the component tier. That's where application logic goes. This is exactly what WebClasses are all about—populating the middle tier with application logic that can be accessed via HTTP, MSMQ, or DCOM.
The bottom layer of a DNA application is data access, which as I said earlier, is something Visual Basic is very good at. The bottom layer in a Web-delivered application would be a WebClass speaking through ADO to OLE DB data sources, including both structured sources of data such as SQL Server and unstructured sources of data such as Microsoft Index Server. They can all be accessed using the same programming model. This is the real power behind a concept like DNA.
MSDN: Do you think we're seeing the beginning of the Web being used for real three-tier application development?
Stutz: Yes, absolutely. We really think that in the future developers will want almost every application they build to be distributed. DNA gives us a roadmap on how to get there from where we are today.
Visual Basic 6.0 helps you get to the point where we might have, for instance, Web farms with more than one machine on the back end and thousands of clients speaking to them on the front end through Web browsers. It's now possible, with Visual Basic 6.0, to build this kind of an application, and build it in a very scalable way.
MSDN: Let's end on a broad question. What does the future hold for WebClasses and Web application development with Visual Basic? What long-term trends do you foresee?
Stutz: The interesting thing that has happened is that the network has become so widespread and so ubiquitous that we are now living in a state of controlled chaos, where there are lots of machines that want to talk between themselves to accomplish tasks. What that implies for programmers building applications is that they need good, simple, robust ways to build applications that can run on many different machines.
In the past, it might have been good to use client-server as a metaphor, where you always connect to the server to do your work and have a rich client do a lot of the processing.
In the future, we're going to see clients with many different form factors. For instance, we'll have Windows CE devices, Web TVs, and PCs talking to many different back ends at the same time or serially (one after the other), in order to accomplish tasks. People will need new mechanisms, such as WebClasses, to build applications for all those clients.
Visual Basic 6.0 provides many interesting ways for these machines to talk. It supports creating objects on other machines via DCOM. It supports talking to servers via HTTP, through WebClasses. It even supports talking to machines using low-level protocols such as Winsock. A final interesting way to talk to other machines is using Microsoft Message Queue. With MSMQ, you can take class modules created in Visual Basic 6.0 and persist them directly onto a queue for delivery now or later to another machine. This is fantastic stuff, and leads to very simple and robust distributed applications.
All of these ways of talking among many machines are much easier to do now with Visual Basic 6.0. We'll continue to move Visual Basic in this direction as the world becomes more and more distributed.
For information about building Web technologies into applications developed with Visual Basic 5.0, see David Stutz's "Accessing the Dynamic HTML Object Model from Within Visual Basic 5.0."