Difference between revisions of "App Bean Config"
From ADF Docs
(→Inject ADF Library) |
(→Inject ADF Library) |
||
Line 29: | Line 29: | ||
=== Inject ADF Library === | === Inject ADF Library === | ||
− | * Inject the ADF library components into the | + | * Inject the ADF library components into the applications bean object. |
<source lang="java"> | <source lang="java"> | ||
// Dependecies from ADF Lib | // Dependecies from ADF Lib |
Revision as of 14:35, 26 March 2010
Contents
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 three sections:
Initialization
- Set up variables to be used in this configuration file.
- Load the ADF application App component. This establishes the bean for the application by creating the singleton object where the dependencies will be injected.
// App specific variables
appBeanName = "STARTER_APP";
// Get the com path for the current custom application
appComPath = getComPathForCustomAppDir(GetCurrentTemplatePath());
// Load the APP Base
addSingleton("#appComPath#App", appBeanName);
Inject Components
- Inject the ADF application components in the applications bean object. Create singletons, transients, and dependencies for the specific components.
// Load the STARTER APP service component
addSingleton("#appComPath#myComponent", "myComponent");
addConstructorDependency(myComponent, "myComponent");
addTransient("#appComPath#myOtherComponent", "myOtherComponent");
Inject ADF Library
- Inject the ADF library components into the applications bean object.
// 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.