The LightWire Config File

The structure of this file may change, but right now it seems to be working well for a 0.01 release :-> Any input always appreciated.

Below is a typical LightWire config file:

<!--- LIGHTWIRE CONFIGURATION FILE config/LightWireConfig.cfm --->
<!--- I set all of the configuration properties for the LightWire Object Factory --->
<!--- I get included into the LightWire init method --->
   // LIGHTWIRE PARAMETERS    // LazyLoad - Should LightWire use lazy loading or just load all singletons on startup?    // Default = 0 (don't lazy load)    // SYNTAX: variables.LightWire.LazyLoad = [1/0];
   variables.LightWire.LazyLoad = 1;
   // Base Class Path - The base path including mapping to your components directory    // SYNTAX: variables.LightWire.BaseClassPath = "";    variables.LightWire.BaseClassPath = "";
   // LIGHTWIRE CLASS PATHS (Required: needed for every Singleton and Transient class)    // SYNTAX: variables.Class.[Singleton/Transient].[ClassName].Path = "path"    // EXAMPLE: variables.Class.Singleton.PageService.Path = "custom.model.Page";    // EXAMPLE: variables.Class.Transient.UserObject.Path = "custom.model.User";    variables.Class.Singleton.CFTemplate.Path = "lib.generate";
   variables.Class.Singleton.Generator.Path = "lib.generate";
   variables.Class.Singleton.PageService.Path = "custom.model.Page";
   variables.Class.Singleton.PageDAO.Path = "custom.model.Page";
   variables.Class.Singleton.UserService.Path = "custom.model.User";
   variables.Class.Singleton.UserDAO.Path = "custom.model.User";
   variables.Class.Transient.PageObject.Path = "custom.model.Page";

   // LIGHTWIRE DEPENDENCIES (only needed if the object has one or more dependencies)    // SYNTAX: variables.Dependencies.[ClassName] = "[comma delimited list of class names it depends on]";    // EXAMPLE: variables.Dependencies.PageService = "PageDAO,UserService";    variables.Dependencies.PageService = "PageDAO,UserService";
   variables.Dependencies.UserService = "UserDAO";
   variables.Dependencies.PageObject = "PageDAO,UserService";
   // CLASS SPECIFIC CONFIGURATION PROPERTIES (If you'd like to be able to set them here as opposed to in the class init files)    // All of these properties will be injected into the appropriate objects on instantiation   
   // Page Service    variables.PageService.ObjectName = "Page";
   variables.PageService.ObjectTitle = "Page";

   // Page DAO    variables.PageDAO.TableName = "tbl_Page";
   variables.PageDAO.ViewName = "tbl_Page";

   // Page Object    variables.PageObject.ObjectName = "Page";
   variables.PageObject.ObjectTitle = "Page";

   // User Service    variables.UserService.ObjectName = "User";
   variables.UserService.ObjectTitle = "User";

   // User DAO    variables.UserDAO.TableName = "tbl_User";
   variables.UserDAO.ViewName = "tbl_User";
<!--- END LIGHTWIRE CONFIGURATION FILE config/LightWireConfig.cfm --->

The configuration properties are as follows:

  • Lazy Load - optional - By default LightWire will just load all singletons on being called. If you would like lazy loading, just set variables.LightWire.LazyLoad = 1.
  • Base Class Path - required - Often you want to reuse a config file, but you have to change the base mapping when moving from one project to another. I figured it would be nice to provide an optional “base class path” so if your class path starts with a project specific mapping you would only have to change one line in the config files when creating a new project. Also helps if you have a really long component path. Syntax: variables.LightWire.BaseClassPath = "[YourBaseClasssPath]";
  • Class Paths - required (one per class) - You need to provide the path to each class file that you want to be able to instantiate. This will be concatenated with the base class path before it and the class name after it, so if you have a with as the base path, the class path would just be “custom.controller”. Syntax: variables.Class.[Singleton/Transient].[ClassName].Path = "path"
  • Dependencies - optional (one per class that has dependencies) - This is where you can simply provide a comma delimited list of dependencies for any given class. Note that either singletons or transients can have dependencies, but obviously they can only be dependent on singletons. If you have transients dependent on other transients that would have to be mixed in after creation using application specific logic. Syntax: variables.Dependencies.[ClassName] = "[comma delimited list of class names it depends on]";
  • Class Specific Configuration Properties - optional (one per property to inject into a given class) - This is where you can set any properties you’d like to have injected into a given class. Note that you should NOT include objects to inject in this structure. They should just be listed in the dependencies section above. Syntax: variables.[ClassName].[PropertyName] = [PropertyValue];

Please feel free to play with the code at RIA Forge and let me know if you have any questions. This is my first OSS project, so be gentle :->

Rolex's Gravatar they are high quality timepieces which is attractive,<A href="://" title="Cheap Brand Name

Watches">Rolex</A> -
<A href="://" title="Replica Rolex">Replica Rolex</A> -
<A href="://" title="Brand Name Watches">Replica Watches</A> -
<A href="://" title="Welcome to our Replica Watches website">Replica rolex</A> -
<A href="://" title="high quality timepieces">Rolex</A> -
<A href="://" title="high quality timepieces">Rolex</A>
<A href="://" title="cheap price">Rolex</A>
<A href="://" title="cheap price">Replica Rolex</A>
<A href="://" title="cheaper price">Rolex</A>
<A href="://" title="cheaper price">Replica Rolex</A>
<A href="://" title="cheaper vertu">Vertu</A>
<A href="://" title="cheaper Replica vertu">Vertu Replica</A>
,good time!
# Posted By Rolex | 7/28/09 2:29 AM
Guojuicycoutureout's Gravatar :// coach factory outlet
:// coach outlet online
:// coach outlet
:// coach outlet online
:// juicy couture outlet online
:// Coach outlet store online
:// Coach outlet online
:// coach outlet store online
# Posted By Guojuicycoutureout | 11/27/11 10:21 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress