Skip to main content
Known Participant
October 16, 2008
Question

1 vs many app.cfm

  • October 16, 2008
  • 1 reply
  • 374 views
Which one is better (see below) ?
Under the wwwroot dir I have 4 root folders, MyFirstApp,MyFirstApp1,MyFirstApp2,MyFirstApp3 AND 1 application.cfm

Within each of these folders (MyFirstApp to 3), there are .cfm files that represent different applications (they are directly or indirectly related to each other)

Within the application.cfm, an application.dsn for each web application (MyFirstApp to 3) is set:
The structure of application.cfm looks like this:
<cfapplication name="Test" sessionManagement="yes" clientManagement="Yes" sessiontimeout=#CreateTimeSpan(0,0,1,0)#>

<cfset application.dsn1= "MyFirstApp">
<cfset application.dsn2= "MyFirstApp1">
<cfset application.dsn3= "MyFirstApp2">
<cfset application.dsn4= "MyFirstApp3">

So on my 1st. scenario, I have this structure:
wwwroot
MyFirstApp
MyFirstApp1
MyFirstApp2
MyFirstApp3
application.cfm >> this is the only application.cfm for the entire web applications where all the application.dsn are set

I think the following should be more proper but I'm not sure why or if it is even matter:
Can anyone give me some thought?

wwwroot
MyFirstApp

MyFirstApp1
application_formMyFirstApp_1 >>> <cfset application.dsn1= "MyFirstApp1">

MyFirstApp2
application_formMyFirstApp_2 >>> <cfset application.dsn2= "MyFirstApp2">

MyFirstApp3
application_formMyFirstApp_1>>> <cfset application.dsn3= "MyFirstApp3">

application.cfm >>> <cfset application.dsn= "MyFirstApp">
This topic has been closed for replies.

1 reply

Inspiring
October 16, 2008
This maybe exactly what you meant, but to be absolutely clear I would
write it this way.

wwwroot
MyFirstApp
application.cfm >>> <cfset application.dsn= "MyFirstApp">

MyFirstApp1
application.cfm >>> <cfset application.dsn1= "MyFirstApp1">

MyFirstApp2
application.cfm >>> <cfset application.dsn2= "MyFirstApp2">

MyFirstApp3
application.cfm >>> <cfset application.dsn3= "MyFirstApp3">


It is important that we are crystal clear that all the files will be
named 'application.cfm' or more properly 'Application.cfm' [this matters
on 'nix systems]. Application.cfm is the only file that will be looked
for by ColdFusion, not anything named something like
application_forMyFirstApp.cfm

If this is what was meant, then I absolutely agree with it. Because
this means that you now have four applications. Each with their own,
required data and nothing extra. Assuming that in the <cfapplication
name="aString" ...> tag, you provide a unique string for the name of
each application.

It is this string that actually separates one application from another
inside of ColdFusion's memory. If all four of those application.cfm
files contained a <cfapplication...> tag with the same string for the
name parameter, it would still be considered all one application
according to ColdFusion.
aleckenAuthor
Known Participant
October 17, 2008
Ian, thanks for the explanation. that's what I meant exactly.