Scratching the surface of WebClasses: A discussion with
Jesse Liberty
by Manohar Kamath
September 2, 1999
We had an opportunity to talk with Jesse Liberty, an acclaimed
author of many books including Clouds to code and Beginning Object-Oriented Analysis and Design : With C++ Jesse's latest book is
"WebClasses From Scratch" published by QUE, Corp., as a part of "From
Scratch" series written by him. The book is due out sometime October 1999.
We couldn't have gotten a better person than Jesse himself to
talk discuss WebClasses, a new feature in Visual Basic 6. In this discussion, we attempt
to understand, among other things, what webclasses are, their benefits, etc.
Manohar Kamath: What are WebClasses? How are they
different from say ActiveX DLLs?
Jesse Liberty: WebClasses are VB programs, implemented as
DLLs, which work with HTML pages to produce WebApplications. You write an HTML page and
you put in special tags, such as <WC@NumberOfEmployees>. When the WebClass processes
the page it will find each tag and replace it with the results of whatever work you
choose. For example, in response to the WC@NumberOfEmployees you might make a database
call and replace the tag with the number of employees.
You can replace the tag with HTML or even with other tags, which
can in turn be processed by your WebClass. This is an enormously powerful and flexible
architecture for developing Web applications.
Every WebClass object has full access to the ASP object model, so
anything you can do with ASP you can do with WebClasses. WebClasses are superior in many
ways, and inferior in a few ways as well.
What is the advantage of a WebClass over its
corresponding ASP page
The single biggest advantage is that you are developing using
Visual Basic rather than a scripting language. This gives you both a more robust
development language, and at least as important, a far more powerful and reliable
development and debugging environment. WebClasses can also do a better job of separating
the HTML from the code, and more important WebClasses provide better support for DNA
(Distributed interNet Application) -- that is n-tier -- architecture.
Can WebClasses do database access?
Database Access is one of the primary purposes of WebClasses, and
my book, WebClasses From Scratch was originally titled Web Databases From Scratch.
With ASP, a programmer can focus on the code logic while
a designer makes the page pretty - a very collaborative effort. Doesn't WebClasses make a
designer's life harder?
Just the opposite. By pulling the code out of the html,
WebClasses enhance that collaboration. The designer can work on the HTML without regard to
the code. An advanced designer can drop WebClass tags into the HTML, and the developer can
write the code to replace these tags with the results of database calls and other
programming.
Does one WebClass correspond to one ASP page? Or can you
code the entire application within a webclass?
No, one WebClass represents the entire application; but you can
include any number of HTML pages into your webClass. One of the things I show in
WebClasses From Scratch is that it is very easy to move an ASP application into a WebClass
application. Essentially, you just move all the script into Visual Basic, and you add the
appropriate tags to your HTML pages, and then add each HTML page to the WebClass project.
Doesn't using WebClasses add a maintenance overhead?
Now every time you update the logic, you need to recompile the
code and re-register the DLL? This is that much harder if you are hosting on an external
web host. Yes, that is one of the disadvantages of WebClasses. On the other hand, it is
far easier to debug the code and to extend the code because you have more robust tools
available.
Although WebClasses have their own advantages, doesn't
the development add to the cost? If I want to develop ASP pages, I can pretty much need
nothing (Maybe Notepad, which is free!) But creating WebClasses means I need to buy Visual
Basic 6 - that's some hundreds of bucks!
Oh yes. If the cost of VB is a significant factor, then
WebClasses may not be the right answer. Frankly, however, for most commercial
applications, the cost of developer time swamps the cost of the tool.
Under what situations is using webclasses
a. Justified
b. Absolutely important
c. Absolutely foolish
I think WebClasses are justified for any serious Web Application,
important if reliability and development time are important. The key factor in my mind is
this: development time is expensive, and any approach which allows you to use a mature,
well-designed development environment is welcome.
It is foolish to use WebClasses if you must deploy to a web site
on which you will not be permitted to put a DLL (such as a hosted environment at an ISP).
I haven't seen many people using WebClasses (at least I
don't use them). Do you think Microsoft will continue support for this in the next version
of VB?
My understanding is that they are very committed to WebClasses.
WebClasses are new, it takes a while for folks to make the transition, but my hope is that
my book will provide a much-needed stepping-stone.
What are some of the good resources for WebClasses -
books, sites, etc.?
This is perhaps the hardest question to answer; to date there
have been few resources. Perhaps the best site for the moment is
http://support.microsoft.com/support/default.asp?PR=webcls&FR=0&SD=SO&

Other useful pages include:
http://www.microsoft.com/mind/0499/inthisissue0499.htm

http://msdn.microsoft.com/vbasic/technical/tutorial/tour/webclass.asp

and of course I provide support on my site at http://www.libertyassociates.com
- just click on
Books & Resources.
|