Difference between revisions of "App Bean Config"

From ADF Docs
Jump to: navigation, search
(Architecture)
(Architecture)
Line 8: Line 8:
  
 
* Initialization: Set up variables to be used in this configuration file.
 
* Initialization: Set up variables to be used in this configuration file.
<code lang="java">
+
<source lang="java">
 
// App specific variables
 
// App specific variables
 
appBeanName = "STARTER_APP";
 
appBeanName = "STARTER_APP";
 
// Get the com path for the current custom application
 
// Get the com path for the current custom application
 
appComPath = getComPathForCustomAppDir(GetCurrentTemplatePath());
 
appComPath = getComPathForCustomAppDir(GetCurrentTemplatePath());
</code>
+
</source>
 
   
 
   
 
* Load the ADF application [[ADF_Core_App|App]] component.  This component creates the ADF application singleton where the dependencies will be injected.
 
* Load the ADF application [[ADF_Core_App|App]] component.  This component creates the ADF application singleton where the dependencies will be injected.
<code lang="java">  
+
<source lang="java">  
 
// Load the APP Base
 
// Load the APP Base
 
addSingleton("#appComPath#App", appBeanName);
 
addSingleton("#appComPath#App", appBeanName);
</code>
+
</source>
  
 
* Load the ADF application components.  Create singletons, transients, and dependencies for the specific components within the custom application.
 
* Load the ADF application components.  Create singletons, transients, and dependencies for the specific components within the custom application.
<code lang="java">  
+
<source lang="java">  
 
// Load the STARTER APP service component
 
// Load the STARTER APP service component
 
addSingleton("#appComPath#myComponent", "myComponent");
 
addSingleton("#appComPath#myComponent", "myComponent");
 
addConstructorDependency(myComponent, "myComponent");
 
addConstructorDependency(myComponent, "myComponent");
 
addTransient("#appComPath#myOtherComponent", "myOtherComponent");
 
addTransient("#appComPath#myOtherComponent", "myOtherComponent");
</code>
+
</source>
  
 
* Load the ADF library components.  Create the dependencies to the ADF application singleton.   
 
* Load the ADF library components.  Create the dependencies to the ADF application singleton.   
<code lang="java">
+
<source lang="java">
 
// Dependecies from ADF Lib
 
// Dependecies from ADF Lib
 
addConstructorDependency(appBeanName, "cedata_1_0", "cedata");
 
addConstructorDependency(appBeanName, "cedata_1_0", "cedata");
 
addConstructorDependency(appBeanName, "scripts_1_0", "scripts");
 
addConstructorDependency(appBeanName, "scripts_1_0", "scripts");
</code>
+
</source>
  
 
== App Component (App.cfc) ==
 
== App Component (App.cfc) ==

Revision as of 14:02, 26 March 2010

Overview

The App Bean Config is the ADF application configuration file for the LightWire object factory. This file establishes the bean configuration with application-specific components and ADF library components.

The App Bean Config must have the file name 'AppBeanConfig.cfm' and be located at the root of the ADF application directory.

Architecture

The App Bean Config is separated into four sections:

  • Initialization: Set up variables to be used in this configuration file.
// App specific variables
appBeanName = "STARTER_APP";
// Get the com path for the current custom application
appComPath = getComPathForCustomAppDir(GetCurrentTemplatePath());
  • Load the ADF application App component. This component creates the ADF application singleton where the dependencies will be injected.
 
// Load the APP Base
addSingleton("#appComPath#App", appBeanName);
  • Load the ADF application components. Create singletons, transients, and dependencies for the specific components within the custom application.
 
// Load the STARTER APP service component
addSingleton("#appComPath#myComponent", "myComponent");
addConstructorDependency(myComponent, "myComponent");
addTransient("#appComPath#myOtherComponent", "myOtherComponent");
  • Load the ADF library components. Create the dependencies to the ADF application singleton.
// Dependecies from ADF Lib
addConstructorDependency(appBeanName, "cedata_1_0", "cedata");
addConstructorDependency(appBeanName, "scripts_1_0", "scripts");

App Component (App.cfc)

All custom applications must contain the App component (App.cfc).

This file is a simple component used as the base object for the custom application where all dependencies will be injected. This component extends the AppBase component in the ADF Core.