Tuesday, June 29, 2004

(COM) Writing COM Objects with Scripting Languages

Writing COM Objects with Scripting Languages
Dino Esposito
Microsoft Corporation

November 1998

Note This article explores older scripting technologies. For information on new scripting technologies, please see Windows Script Components: They Get Around.
Summary: Compares the DHTML and XML scripting languages and discusses the pros and cons of building Component Object Model (COM) objects with each. (15 printed pages)

DHTML vs. XML Scriptlets
The XML Scriptlets Architecture
XML Scriptlet Files
Interface Handlers
The Automation Handler
XML Scriptlets and Windows Script Host
XML Compliance

Introduction
Technology is rapidly evolving, there's no doubt about it. If you want proof, however, consider this story: Once upon a time, about a year ago, little actors called scriptlets made their debut in the dynamic HTML (DHTML) theatre. They were HTML pages acting as real components. They exposed properties and methods. Scriptlets were also capable of bubbling system events and firing their own notifications. Judging from this, they were really a great and decisive step forward in the long run to componentize the Web. Due to scriptlets, writing reusable HTML code was no longer an issue. You could arrange an HTML component, such as a data-aware table, make it as parametric as possible, and use just a line of code to insert it in any page. Seemingly the only drawback to scriptlets was the cross-browser compatibility issue, because their use was limited to Microsoft Internet Explorer 4.0 and later software.

But as I said earlier, technology is rapidly evolving. So what yesterday were revolutionary and cutting-edge solutions are today going to be superseded by more general and powerful approaches. That's just what happened to scriptlets. Only a few months after their release—they originally shipped with Internet Explorer 4.0—scriptlets were renamed to the more specific Dynamic HTML scriptlets. The role of Dynamic HTML scriptlets was then reduced by an emerging new technology called XML scriptlets or, now, simply scriptlets.

As a result, today we have two possible choices when it comes to designing script components to be used in Web-based projects. The first is DHTML scriptlets, and the second is XML scriptlets. They aren't mutually exclusive, but each has its own independent and well-defined field of application. Furthermore, at least in principle, you can use both either on the client or the server side of the Web application.

No comments: