Advantages
If you are new to scripting, you can write scripts that use components without
knowing anything about how the component works. ASP comes with base components
that you can use immediately. For example, you can use the ActiveX Data Objects
(ADO) components to add database connectivity to your Web pages. Additional components
can also be obtained from third-party developers. If you are a Web application
developer, components are the best way to encapsulate your business logic into
reusable, secure modules. For example, you could use a component to verify credit
card numbers by calling the component from a script that processes sales orders.
Because the verification is isolated from the order process, you can update the
component when the credit card verification process changes, without changing
your order process.
Also, since COM components are reusable, you could reuse the component in other
scripts and applications. Once you have installed a component on your Web server,
you can call it from a ASP server-side script, an ISAPI extension, another component
on the server, or a program written in another COM-compatible language. You can
create components in any programming language that supports the Component Object
Model (COM), such as C, C++, Java, Visual Basic, or numerous scripting languages.
(If you are familiar with COM programming, COM components are also known as Automation
servers.)
To run on the Web server, your COM components cannot have any graphical user
interface elements, such as the Visual Basic MsgBox function; graphical interface
elements would only be viewable on the server, and not the browser. Creating
an Instance of a Component's Object A component is executable code contained
in a dynamic-link library (.dll) or in an executable (.exe) file. Components
provide one or more objects, self contained units of code which perform specific
functions within the component. Each object has methods (programmed procedures)
and properties (behavioural attributes).