In the previous chapter, when we talked about Remote Scripting we used a term like server-side scriptlet. In this chapter we're facing a very similar expression—"Server Scriptlet". Are they different? Yes, they differ quite a lot. What we called server-side scriptlets were Javascript function objects defined and executed on the server. What Microsoft have called Server Scriptlets are, instead, scriptlets that appear to be functionally equivalent to COM servers.
When you think of a COM server what usually comes to mind is a kind of black-box exposing a number of methods and properties. These methods and properties can be called from within a Visual Basic form, or a HTML page, or any other development tool that is COM-aware. With Server Scriptlets you have such a component, but it is written in a script language such as VBScript, Javascript, or even PerlScript or Python.
The DHTML Scriptlets we've discussed so far do, however, expose the automation interface made of properties and methods—so what's different with Server Scriptlets? There's one big difference: Server Scriptlets are already real COM objects and can be exploited from any development environment just as they are. You make use of them in the same way that you would use any other COM component. That is—you create a new instance of the given object and identify it through its name. To be precise, this name is known as
. Usually it is a string like ProgID
. Name.Something
From this it is possible to identify other differences that exist between Server and DHTML Scriptlets. First and foremost, Server Scriptlets require registration and are identified through a CLSID in addition to a ProgID. There are more differences but these will be addressed later in the chapter. For now let's move up to a higher level
Despite use of the word "Server", a Server Scriptlet is not specifically related to any topics inherent to Active Server Pages (ASP). Therefore, we have to conclude that the name chosen is just misleading. The name actually comes from the word 'Server', which denotes that the component works as a server and 'scriptlet', which emphasizes its construction from script code.