title: Custom methods inside Application.cfc
body: <p>We have four different environments: dev, q/a, test and prod. I decided to convert our <code>Application.cfm</code> to <code>Application.cfc</code> and put them in our source control. There are plenty application vars that have different values for each environment. </p>
  
  <p>I ended up creating several sql server tables to store these environment variables based on their types. Now, I am in the middle of dynamically setting up these application variables. </p>
  
  <p>My question is that I started adding custom methods inside application.cfc. I am not 100% sure if this is the best place. [For example: getAppLinks(), setAppLinks() ]. Otherwise, I could create a new cfc and call this one from <code>Application.cfc</code>. </p>
  
  <p>All these methods are currently being called once in the <code>onApplicationStart()</code> method. </p>
  
  <p>Does anybody have any comments on implementing custom methods in <code>Application.cfc</code>? </p>
  
  <p>thanks</p>
  
  <p>edited: added a custom method:</p>
  
  <pre><code> &lt;cffunction name="setUpAppDSNs" access="private" returnType="void" output="false"&gt;
      &lt;cfargument name="dsn"        type="string" required="yes"&gt;
      &lt;cfargument name="serverName" type="string" required="yes"&gt;
      &lt;cfscript&gt;
          var dsnNames   = structNew();           
          var qryAppDSNs = new Query(dataSource = '#arguments.dsn#',  
                                     sql        = ' SELECT dsnID, #arguments.serverName#Server, description
                                                    FROM cfAppDSN ').execute().getResult();  
           for (i = 1; i lte qryAppDSNs.recordCount; i++) {
              dsnNames['#qryAppDSNs.description[i]#'] = qryAppDSNs['#serverName#Server'][i]; 
           }
  
           StructAppend(application,dsnNames);
      &lt;/cfscript&gt;
  &lt;/cffunction&gt;
  </code></pre>