Library tutorials & articles

Using Components and Objects in ASP

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).

Comments

  1. 22 Feb 2004 at 23:46
    In an interview, they asked me what are the components of ASP and VB. Can any body help me?.
  2. 17 Jul 2002 at 08:02

    If you want to try using components, start using those allready installed on your server. Use this script to check your IIS for installed components:
    http://www.bier-voting.de/objcheck/
     

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of Using Components and Objects in ASP.

Leave a comment

Sign in or Join us (it's free).

Talal Ahmed Siddiqui

Want to stay in touch with what's going on? Follow us on twitter!