Just pass it in as an argument. 

<cfset obj = createObject("component",
"mycfc").init(datasource="myDatasource")> 

Ensure your init() method returns "this" to use the syntax above.
Alternatively, make a small struct of useful settings and pass that in. 


-----Original Message-----
From: Stan Winchester [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 29 November 2005 2:16 p.m.
To: CF-Talk
Subject: Using request var in CFC - was : FREE Homesite/CF Studio CFC
VTML Generator

What is best practise for passing dsn variable to cfc? In the CFMX (v
6.x) Bible shows using request variables to pass dsn, but Douglas says
that is Blasphemy!  Heresy!, well he was just kidding, but seriously
what is best practise? Should it be passed as an argument?

> >
> > Why should I pass the DSN to the CFC and use the request scope? I
> based this wizard off chapters in the CFMX Bible.
> 
> CFMX Bible, you say?  Blasphemy!  Heresy!  ha!  J/K  It is excepted 
> practise to never use vars outside the CFC.
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225478
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to