> The post about user-dependent DSNs was from someone responding to my
original question.
Yeah, that was me :)

> call application.config.getDSN()
Yes, let's see some code!

> What would be the benefit of this approach
Hello!  Brian and Peter are saying
"I'm just so spoiled by ColdSpring that I would never build an app
without it".
Let's cut to the chase and see an example using ColdSpring.




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe
Lakey
Sent: Friday, June 08, 2007 9:39 AM
To: cfcdev@cfczone.org
Subject: RE: [CFCDEV] Application.cfc: where to set DSN

The post about user-dependent DSNs was from someone responding to my
original question. My app uses only one DSN.

To use a Config CFC, would I hard-code the settings variables in the
Config CFC file, instantiate it in application scope in
onApplicationStart(), then call application.config.getDSN() (for
example)? What would be the benefit of this approach over including a
settings file in onApplicationStart() and/or onRequest()?

Thanks,
Joe

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
> Of Brian Kotek
> Sent: Thursday, June 07, 2007 1:44 PM
> To: cfcdev@cfczone.org
> Subject: Re: [CFCDEV] Application.cfc: where to set DSN
> 
> I suppose the question here is, why not consolodate them all 
> in exactly one place: a Config CFC?
> 
> From what you said you wouldn't want to set the DSN to 
> application.dsn in onApplicationStart() becuase then its not 
> variable. I thought you said the DSN depends on the type of 
> user. So if you're going to keep down this road, wouldn't you 
> set it to session.dsn in onSessionStart()?
> 
> 
> 
> 
> On 6/7/07, Joe Lakey <[EMAIL PROTECTED]> wrote:
> 
>       This is what I've done in the past, but I'm trying to 
> consolidate these
>       configuration-type settings into as few places as 
> possible. Setting them
>       in request scope seems to be the recommended approach. 
> I guess the 
>       compromise would be setting Application.DSN in 
> onApplicationStart() and
>       setting request.DSN=Application.DSN in my config file 
> that I include in
>       onRequest()?
>
>       Joe
>
>       > -----Original Message-----
>       > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
>       > Of Sammy Larbi
>       > Sent: Thursday, June 07, 2007 11:43 AM
>       > To: cfcdev@cfczone.org <mailto:cfcdev@cfczone.org> 
>       > Subject: Re: [CFCDEV] Application.cfc: where to set DSN
>       >
>       > Hi Joe,
>       >
>       > In my view, a DSN is a variable that properly belongs to an
>       > application.  Therefore, I'd go with putting it in 
>       > onApplicationStart,
>       > since by the very nature of its name, implies that 
> you are setting
>       > variables belonging to the application.
>       >
>       > Others may view it differently, however.
>       >
>       > Sam 
>       >
>       >
>       > Joe Lakey wrote, On 6/7/2007 11:03 AM:
>       > > Another newbie question to provide a little light 
> diversion from
>       > > interfaces and method overloading...
>       > >
>       > > My application uses only one DSN, and I'd like to set it in 
>       > one place.
>       > > I'm cfincluding two files in onRequest():
>       > server_config.cfm, which sets
>       > > server/environment variables, and app_config.cfm, which sets
>       > > application-specific variables; both set variables in 
>       > Request scope. It
>       > > would seem that one of these includes would be the place to
>       > set the DSN,
>       > > i.e., <cfset Request.DSN = "myDSN">. However, in
>       > onApplicationStart() 
>       > > and onSessionStart() I'm instantiating components that take
>       > the DSN as
>       > > an argument to their init() methods. If I understand the
>       > sequence that
>       > > Application.cfc methods are executed, 
> onApplicationStart() and 
>       > > onSessionStart() won't have access to variables set in
>       > onRequest(). So
>       > > if I want to set the DSN in only one place, where is the
>       > best place to
>       > > do it?
>       > > 
>       > > It's probably obvious (and there's probably a better way to
>       > architect
>       > > the whole app to avoid this, but...), but I'm still 
> getting my mind
>       > > around this OO stuff.
>       > >
>       > > Thanks,
>       > > Joe
>       > >
>       > >
>       > > You are subscribed to cfcdev. To unsubscribe, please follow
>       > the instructions at 
> http://www.cfczone.org/listserv.cfm 
> <http://www.cfczone.org/listserv.cfm> 
>       > >
>       > > CFCDev is supported by:
>       > > Katapult Media, Inc.
>       > > We are cool code geeks looking for fun projects to rock!
>       > > www.katapultmedia.com <http://www.katapultmedia.com> 
>       > >
>       > > An archive of the CFCDev list is available at
>       > www.mail-archive.com/cfcdev@cfczone.org
>       > >
>       > >
>       > >
>       > >
>       >
>       >
>       >
>       > You are subscribed to cfcdev. To unsubscribe, please follow
>       > the instructions at http://www.cfczone.org/listserv.cfm 
>       >
>       > CFCDev is supported by:
>       > Katapult Media, Inc.
>       > We are cool code geeks looking for fun projects to rock!
>       > www.katapultmedia.com
>       >
>       > An archive of the CFCDev list is available at
>       > www.mail-archive.com/cfcdev@cfczone.org
>       >
>       >
>
>
>       You are subscribed to cfcdev. To unsubscribe, please 
> follow the instructions at http://www.cfczone.org/listserv.cfm
>
>       CFCDev is supported by:
>       Katapult Media, Inc.
>       We are cool code geeks looking for fun projects to rock!
>       www.katapultmedia.com <http://www.katapultmedia.com> 
>
>       An archive of the CFCDev list is available at 
> www.mail-archive.com/cfcdev@cfczone.org
>
>
> 
> 
> 
> You are subscribed to cfcdev. To unsubscribe, please follow 
> the instructions at http://www.cfczone.org/listserv.cfm
> 
> CFCDev is supported by:
> Katapult Media, Inc.
> We are cool code geeks looking for fun projects to rock!
> www.katapultmedia.com
> 
> An archive of the CFCDev list is available at 
> www.mail-archive.com/cfcdev@cfczone.org
> 


You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org



You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/cfcdev@cfczone.org

Reply via email to