Difference between revisions of "App Bean Config"

From ADF Docs
Jump to: navigation, search
(Architecture)
Line 5: Line 5:
  
 
== Architecture ==
 
== Architecture ==
The App Bean Config is separated into 5 sections.  
+
The App Bean Config is separated into 6 sections:  
* Initialization, setup for the variables to be used in this configuration file.
+
* Initialization: set up variables to be used in this configuration file.
 
   // 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());
* Load the custom application App component.  This components extends the Core Application Base component (\ADF\Core\AppBase.cfc) in the ADF [[Core]].  This creates the custom applications singleton where the dependencies will be injected.
+
* Load the custom application App component.  This component extends the Core Application Base component (\ADF\Core\AppBase.cfc) in the ADF [[Core]], creating the custom application singleton where the dependencies will be injected.
 
   // Load the APP Base
 
   // Load the APP Base
 
   addSingleton("#appComPath#App", appBeanName);
 
   addSingleton("#appComPath#App", appBeanName);
Line 24: Line 24:
 
   addConstructorDependency(appBeanName, "cedata_1_0", "cedata");
 
   addConstructorDependency(appBeanName, "cedata_1_0", "cedata");
 
   addConstructorDependency(appBeanName, "scripts_1_0", "scripts");
 
   addConstructorDependency(appBeanName, "scripts_1_0", "scripts");
* Call the ADFOverrides function.  This creates the overrides at the custom application level to the ADF library components.
+
* Call the ADFOverrides function.  This function overrides ADF library components at the custom application level.
 
   // Load the Custom App overrides
 
   // Load the Custom App overrides
 
   ADFOverrides(appComPath, appBeanName);
 
   ADFOverrides(appComPath, appBeanName);
* Call the loadAppSiteComponents function.  This function loads the site level application components into the object factory.  This gives the objects a unique name with the ''AppBeanName_SiteID_ComponentName''.
+
* Call the loadAppSiteComponents function.  This function loads the site level application components into the object factory, giving objects a unique name with the ''AppBeanName_SiteID_ComponentName''.
 
   //Load the site level application components
 
   //Load the site level application components
 
   loadAppSiteComponents(appBeanName);
 
   loadAppSiteComponents(appBeanName);

Revision as of 16:55, 24 January 2010

Overview

The App Bean Config is the custom 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 custom application directory.

Architecture

The App Bean Config is separated into 6 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 custom application App component. This component extends the Core Application Base component (\ADF\Core\AppBase.cfc) in the ADF Core, creating the custom application singleton where the dependencies will be injected.
 // Load the APP Base
 addSingleton("#appComPath#App", appBeanName);
  • Load the custom 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(appBeanName, "MYCOMPONENT");
 */
  • Load the ADF library components. Create the dependencies to the custom application singleton.
 // Dependecies from ADF Lib
 addConstructorDependency(appBeanName, "cedata_1_0", "cedata");
 addConstructorDependency(appBeanName, "scripts_1_0", "scripts");
  • Call the ADFOverrides function. This function overrides ADF library components at the custom application level.
 // Load the Custom App overrides
 ADFOverrides(appComPath, appBeanName);
  • Call the loadAppSiteComponents function. This function loads the site level application components into the object factory, giving objects a unique name with the AppBeanName_SiteID_ComponentName.
 //Load the site level application components
 loadAppSiteComponents(appBeanName);

App Component (App.cfc)

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

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