services


gallery


tutorials


process


contact


links

Gallery:  ColdFusion ASP PHP Shootout

ColdFusion

ASP

PHP

Server Components

Server components encapsulate some programmed functionality in a "black box." They are custom objects that you can add to the environment as needed. Server components are COM objects built on ActiveX technology. They are small programs, written in C++, Visual Basic, or some other language, and compiled. Vast numbers of commercial, shareware and freeware server components are available from many sources, or you can create your own.

Once you've acquired the object you want to use, you may need to register it with Windows in order for ColdFusion (or anything else) to find it. Some objects may be deployed with their own setup programs that register objects automatically, while others may require manual registration.


ColdFusion

The CFOBJECT tag is used to invoke objects created by component technologies. This includes COM/DCOM, CORBA, Java, and EJB objects.

You can only use server-side COM objects in ColdFusion, that is, they should not have a graphical user interface. ColdFusion is an automation (late-binding) COM client. This implies that the COM object has to support the IDispacth interface, and that arguments for methods and properties be standard automation types.

The CFOBJECT tag creates an instance of the object and other ColdFusion tags, such as CFSET and CFOUTPUT, are used to invoke properties (attributes), and methods (operations) on the object. Although example code that comes with COM objects is usually VBScript, it is not difficult to translate the code into ColdFusion syntax. An object created by CFOBJECT or returned by other objects is implicitly released at the end of the template execution.



ASP

There are a few useful server components that are included with IIS and PWS, such as the Advertisement Rotator, Browser Capabilities, Content Linking and Counter components. ASP access databases through a server component called the Data Access Component (DAC).

To access a server component in your ASP page, you create an instance of the object with a single command and then access its properties and methods with your scripting language. You can create the objects in application or session-level variables, or (preferably) with the object tag in the Global.asa file, to make the objects available to multiple pages and/or persistently available within a session or application-wide.



PHP

Beginning with version 4, which,at the time of this writing was just released, PHP apparently now supports Microsoft COM objects (Windows version only of course), but the documentation in the "COM support functions for Windows" section contains no discussion of details.



Copyright © 2005 Cyberglitz

email: info@cyberglitz.com