I'll check out the info... thanks, Guido!
> -----Original Message----- > From: Gerald Guido [mailto:[EMAIL PROTECTED] > Sent: Monday, June 16, 2008 12:02 AM > To: CF-Talk > Subject: Re: cfc question... > > >> Anyway, what's lame about putting all the cfc's together in a directory > where I can find them easily? > > There is nothing lame about it (you gotta stick them somewhere). What he > means is that you are going to want to stick them in memory (the application > scope) cuz there is a lot of overhead with firing them up (instantiating or > creating an instance of them) every time you need to use them. Basically you > are caching them. > > You can do the same thing with functions too. It is pretty damn slick. I > blarged on the matter here: > http://www.myinternetisbroken.com/index.cfm/2008/5/24/Caching-Functions--Creating-variables-that-are - > executable > > G$ > > > On Sun, Jun 15, 2008 at 11:49 PM, Rick Faircloth <[EMAIL PROTECTED]> > wrote: > > > Now, Will... all that's a bit complicated for a newbie to cfc's! > > Didja haf'ta make it so hard! I just wanted a path! :o) > > > > Anyway, what's lame about putting all the cfc's together in a directory > > where I can find them easily? > > > > > > > -----Original Message----- > > > From: Will Tomlinson [mailto:[EMAIL PROTECTED] > > > Sent: Sunday, June 15, 2008 11:00 PM > > > To: CF-Talk > > > Subject: Re: cfc question... > > > > > > >Another issue I've run into is how to help my calling page find > > > >my cfc's. While learning, I've just placed the cfc in the same > > > >folder as the calling page. But now I'm placing them in a components > > > >folder and the calling page can't find it. > > > > > > Rick, I mostly initialize them in application scope in Application.cfc > > > > > > Like this: > > > > > > <cfset APPLICATION.reportDAO = > > CreateObject("component","cfcs.reportDAO").init(dsn=APPLICATION.dsn)> > > > > > > Then build a constructor in your cfc like so: > > > > > > <cffunction name="init" access="public" returntype="reportDAO" > > output="false" > > > hint="Returns an instance of the CFC initialized with the correct > > settings."> > > > <cfargument name="dsn"> > > > <cfset variables.dsn = arguments.dsn> > > > <cfreturn this> > > > </cffunction> > > > > > > Once you do all that, it's ready to use anywhere in the application. > > > > > > Just refer to it using the application scope: > > > > > > <cfset getReport = APPLICATION.reportDAO.monthEnd()> > > > > > > Puttin it in a cfc's directory is lame, but I'm sure more advice will > > roll in for ya. :) > > > > > > hth, > > > Will > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307537 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

