Server Scriptlets: Using Script to Create COM Components

John Swenson
MSDN Online

January 28, 1998

On January 28, Microsoft quietly previewed the beta release of a new component technology at the Web TechEd conference—reusable COM components written in script, called server scriptlets.

I've heard about scriptlets before. What's new here?

The Dynamic HTML scriptlets we introduced last year with Internet Explorer 4.0 are built from HTML and script, run on the client, and are primarily used for user interfaces. Server scriptlets are written in script, and don't use any Dynamic HTML or HTML.

In addition, they don't have a user interface, because they run on the server. Adding a user interface just slows down these small, efficient components.

What can you use server scriptlets for?

Lots of common scripting tasks, such as running middle-tier business logic, accessing and manipulating databases, and adding transaction processing to applications.

Developers can use server scriptlets anywhere they use COM, says Andrew Clinick, Microsoft's program manager for scripting technologies.

How do you build server scriptlets?

Developers can create server scriptlets by componentizing any of their script. They can pull script out of their Active Server Pages (ASP), for example, and package it into a server scriptlet, which can be reused over and over again.

What languages can you use?

Until now, developers have had to build their server-level COM components in Visual Basic, Visual C++, or Java, says Clinick, who introduced server scriptlets to several hundred developers at Web TechEd in Palm Springs, California.

Now, authors and developers who know script can create components using any scripting language that supports the Microsoft ActiveX Scripting interfaces. These include JScript, Visual Basic Scripting Edition (VBScript), PERLScript, PScript, and Python.

How do I get started with server scriptlets?

You can download the beta version of this technology on the server scriptlets page of the Microsoft Scripting Web site (http://www.microsoft.com/scripting/scriptlets/server/default.htm).

The download includes the server scriptlet run-time component, documentation, and examples. There's also a Scripting Wizard designed to simplify the process of creating either Dynamic HTML or server scriptlets.

The wizard asks you whether you want to create a Dynamic HTML or server scriptlet, and then walks you through a series of other steps. It creates a template that developers can use as a starting point to add their own script or Dynamic HTML. (Although the wizard simplifies the creation of Dynamic HTML scriptlets, you don't need to download anything to create Dynamic HTML scriptlets, which run in Internet Explorer 4.0.)

Can I debug the scriptlets?

You can debug your scriptlets with the Microsoft Script Debugger version 1.0, which is also available for download from the Microsoft scripting Web Site (http://www.microsoft.com/scripting/debugger/dbgdown40.htm). The next version of Visual InterDev will also work nicely as a scripting debugger, Clinick says. For information about Visual InterDev see the Microsoft Visual InterDev Web site at http://www.microsoft.com/vinterdev/. Microsoft introduced the upgrade to this professional Web-development tool at Web TechEd. It should enter beta testing in March.

What are the benefits of running server scriptlets?

Server scriptlets let you take advantage of the power of the server without having to write any new client code. By using remote scripting, you can even call server scriptlets without refreshing your Web page on the client. For more information on that technology, check the Microsoft Scripting Library at http://www.microsoft.com/scripting/docs/msl/msl.htm.

Also, since server scriptlets are full-fledged COM components, they can be "completely transactionally aware," Clinick says. "You can create server scriptlet components that work really well with Microsoft Transaction Server."

Are there any differences between using scriptlets and using other COM components?

After you have created a server scriptlet, you can use it in your applications. Using server scriptlets is similar to using other COM components, but there are small differences in how you register server scriptlets. Clinick demonstrated how easy it is to register a new server scriptlet, simply by right clicking on the component's icon and then choosing "register" from a drop-down menu.