First of all thanks to everyone who responded to my question.
Ben, Nolan, and Kerry.

Kerry, your solution sounds really cool, although I have to admit it sort of
went over my head.  I wouldn't know the first thing about how to implement
it.

I work in a tiny CF shop, where we don't have multiple sites.  Just an
intranet and extranet, but several apps on our server.  All of the apps are
similar and somewhat related, so they do a lot of common and similar
functions.  They also all run on the same server.  This is why it makes
sense for me to be able to put things in the CustomTags directory.  That
will NEVER change, unless some future version of CF changes their file
structure.  This way my CFC's are outside of the webroot, yet accessible to
all my apps, without me having to mess with mappings.

However, I would look into the solutions everyone suggested if my needs
changed.  For example if I moved into a multi-server environment, or had
multiple sites and such.

Cheers,
Ali

-----Original Message-----
From: Ben Rogers [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 11, 2005 10:41 AM
To: [email protected]
Subject: RE: [CFCDev] global cfc's

> Ok, I think I figured this out.
> I think I don't need an init function, since all I'm doing is creating a 
> library of functions, not some cohesive object.

Correct. The init() method is just a convention used for initialize an
object which has state. A UDF library does not have (meaningful) state.

> However, if I'm wrong in this assessment, I would love to hear 
> suggestions.
> 
> I can save the CFC in the CustomTags folder of my server and thus just 
> reference the CFC by name.

That's one place. However, if you have multiple sites on the same server,
you might want to put a copy of the file under each site. That way, if you
change the library in a backwards breaking way, you won't have to touch
every site that references the component. Or, you might consider versioning
the file by placing the version number in the file name.

I myself use Subversion for this. Each of my apps has an "externals"
directory that contains references to other repositories, repositories which
contain code that's shared amongst various applications. One such repository
contains function libraries.

When I'm working on a site and I want the latest copy of the function
libraries, I update my local working copy of the functions library. Then, I
export the libraries to wherever those files exist in the current app (or
diff and merge depending on how I'm using the code), make sure I didn't
break anything, and then check in the site.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057



----------------------------------------------------------
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]



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