hum, we had discussed parts of this before and it was said that couldnt be done but 
i'll give it a shot!
thanks

im actually diggin up raymonds galleon and gunna check out his method too



---------- Original Message ----------------------------------
From: "Jim Davis" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Fri, 29 Oct 2004 02:52:24 -0400

>Not really... you can definitely call variables out of application.cfm in
>several ways:
>
>1) You could pass the variables into the CFC as arguments.  This probably
>the "best" way in that the CFC remains self-contained and it's clear from
>the invocation code what it needs.
>
>2) You could assign your variables to a shared scope (application or server,
>for example) and access then directly with in the CFC.  This isn't as "nice"
>as you're hiding required information inside the CFC and creating
>potentially confusing dependencies, but it can be done.
>
>The method I use is to instantiate (in the application.cfm) a
>"DP_PersistenceInfo" CFC - this CFC contains all of the properties related
>to a specific datasource.  This CFC is added to a special "DP_Application"
>CFC which is, itself, stored in the Application scope.
>
>This CFC contains all sorts of application-relevant data - DataSources, SMTP
>profiles, email addresses, paths, etc.  Other CFCs in my applications can
>accept a reference to this CFC as an Init method argument.  Once they have
>that reference they can access all of the configuration information from
>that single source.
>
>Updating the configuration information is done in a single place.
>
>You can do this much more simply just by creating a standardized structure
>of configuration information  and placing it in the Application scope.  You
>can then pass that structure into CFC that might need the information.
>
>That way you have only one argument to worry about and, since structures are
>passed by reference, only one copy of the date to maintain.
>
>
>Jim Davis
>
>-----Original Message-----
>From: dave [mailto:[EMAIL PROTECTED] 
>Sent: Friday, October 29, 2004 2:35 AM
>To: CF-Talk
>Subject: RE: includes and cfc's
>
>well here is the reason why i ask
>(raymond hasnt blogged about using the ini method yet)
>
>i was thinking that since u cant call some variables such as your datasourse
>names outta your Application.cfm file, that you could just include them, so
>u didnt have to (lazily) manually change them.
>
>
>know what i mean?
>
>
>
>---------- Original Message ----------------------------------
>From: "Jim Davis" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>Date:  Fri, 29 Oct 2004 02:22:22 -0400
>
>>-----Original Message-----
>>From: dave [mailto:[EMAIL PROTECTED] 
>>Sent: Friday, October 29, 2004 1:38 AM
>>To: CF-Talk
>>Subject: includes and cfc's
>>
>>> can u include an include in a cfc?
>>
>>You can, but it's better to pretend you can't.
>>
>>There's a nasty little side effect of CFINCLUDE in CFCs: when you CFINCLUDE
>>inside a CFC method all VAR scoped (private) variables are transferred to
>>the CFCs "Variables" scope.  This is, presumably, to allow the CFINCLUDed
>>code to see those values.
>>
>>However all it really does is create a situation where you simply can't
>>create a persistent, thread-safe CFC - it effectively destroys any
>>thread-protection you've creating using method-private values.
>>
>>That's why, in the end, it's much, much simpler and much, much safer to
>just
>>pretend that you can't CFINCLUDE inside a CFC.
>>
>>Jim Davis
>>
>>
>>
>>
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=38

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182905
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to