I have something like this, but I avoid server wide components for various reasons (I like my sites to be modular, independent, portable), although many people would disagree with this approach.
 
So, I have a component called common, which performs a cfdirectory on a subdirectory called common and adds an instance of every cfc it finds in the directory to its this scope.
This only runs once on application start.
 
From now on in all my .cfm's, I can call application.common.string.split()
 
And to add a new common cfc, I simply copy it to the directory, no need to touch any code.
 
To reference this cfc from other cfcs is a more complex topic, and involves the fact that all my cfcs are called from a factory, which gives each cfc a reference to itself when creating them. (there are no createObject("component"."xyz.abc") calls anywhere except in application start).
 
Stop me if I've gone too far....
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Ali Awan
Sent: 11 May 2005 18:00
To: [email protected]
Subject: [CFCDev] global cfc's

I�ve been lurking on this list for quite a while now, and I feel pretty embarrassed for asking such an elementary question.

 

I�m thinking of creating a sort of UDF library that can be used by all my apps.

Does it make sense to create a Component that holds all the functions?  In such a case, what would an init function hold.

For example, if I have a bunch of generic Validation functions, would I need an init function for the CFC?  If so, what would it look like?

 

Also, where would I need to put the CFC on the server so that it is accessible to all my apps?

I�m thinking along the lines of custom tags, where we could just put them in the CustomTags folder and they are accessible to all.

 

Is there such a folder for CFC�s?

 

Thanks,

Ali

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to