INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

ASP 101

All About COM & ASP by RushiShroff
Posted: 11 Apr 02 (Edited 3 May 02)

There are several benefits to moving your business logic and data access code out of your ASP pages and into a COM-based DLL.
First,
ASP is great for small apps, but it becomes increasingly difficult to manage an application that contains thousands of lines of code. Using a class-based language like Visual Basic, Java, or C++ will offer much higher levels of encapsulation and code reuse.

Second, today's multitier designs encourage the use of business objects to separate the user interface code from the data access code. One of the benefits of this separation is that it eliminates the need for SQL in your ASP code.

Third, COM-based DLLs created with Visual Basic can take full advantage of the integration between Internet Information Server (IIS) and the MTS runtime environment. Using MTS components in an ASP-based application gives you an infrastructure for building a reliable OLTP system.

BENIFITS
The main benefits of COM are that Business logic can be shared between multiple applications, scalability, security and reliability.  Just because you move functionality to a COM component means that it will run faster. If the process you have written in VBScript is very large then there is a good chance it will be faster in COM. If it's relatively small code, then it's more likely that it won't be faster.  There are a lot of variables that determine execution/response time.  One thing to think about, if your COM server is separate from your IIS server then every call from the IIS server requires and RPC call across your network.  The more RPC calls you perform, the more likely the repsonse time will be slower.

There are many very good reasons for using COM components other than speed. A properly designed COM layer can make your application easier to build, modify and maintain - for a pro developer, that's often worth a LOT more than performance.

One component can produce a single page displaying simple HTML text, or it can display computed data originating from database tables specifically designed for individual users or groups. An entire interactive site, with multiple related pages, can be contained in one component. Shopping cart systems, a series of reusable input forms with built in data validation, office related information management sites, and many other application can be encapsulated and saved within a single DLL file. The class libraries you build can be saved and reused in other components. As an added bonus, distributing compiling source code in the form of a DLL component will keep your code manageable and protected.

IN NUTSHELL

There are two methods of using MTS components written with Visual Basic in an ASP-based application.
In the first method, this business logic is defined in the class of the Visual Basic-based DLL. In the second method it is defined in ASP code. Both examples uses the MTS runtime environment to guarantee the ACID requirements of their transactions.

In both cases, Visual Basic is used to write the data access layer and ASP is used to define the presentation layer. That is an important characteristic of a three-tier system. The presentation logic never mingles with the data access code. What changes between the first and second method is where the business logic was defined

The fact that IIS/MTS integration allows you to create transactional ASP pages doesn't mean that you have to use them. You might elect to maintain your business logic in a DLL as opposed to ASP code. There are a few reasons you might do this. Using classes available in Visual Basic or C++ will make it easier to maintain and extend your business logic with much better type checking and debugging capabilities. Compiled DLLs give you much better versioning control. Furthermore, you can use these DLLs from standard COM client applications as well as ASP clients.

You might choose to maintain your business logic in ASP because of the advantages of a compile-free development environment. You might find it easier to make revisions without having to rebuild and replace a DLL. Now that you've seen the issues you'll need to consider, you're ready to make that choice.

An excellent resource can be fond at :
www.Develop.com

Back to Microsoft: ASP (Active Server Pages) FAQ Index
Back to Microsoft: ASP (Active Server Pages) Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close