This is a request for comments about an approach I am considering for CFSQLTool's code generation for CFC.

Background. Currently the CFC code generated with CFSQLTool does not include a feature that does instance variables for a table's CRUD CFC. I would like to add that feature.

Example.
  SQL   Table: Contacts
          ContactsID           
            Name
            DateCreate
 
   File: Contacts.CFC

   CF: objContacts = createObject("component","Contacts");


 Problem. CF with getmetadata or cfdump makes no type distinction between variable and function namespaces.

 Approach 1. Create a structure, instance
                          instance = StructNew();
                    instance.Name = "";

     So in code say, objContacts.instance.Name = "Joseph";

 Approach 2.  Use the this scope with $ var name
                         this.$Name = "";
     
       So in code say, objContacts.$Name = "Joseph";

Currently, I like Approach 2 the best. It distinguishes variables names from function names. Less coding than an instance structure.  But I would like to hear other comments or other approaches.

Joseph


-----------------------------------------------------------------------
http://www.switch-box.org/CFSQLTool/Download/

Switch_box                      MediaFirm, Inc.
www.Switch-box.org              Loveland, CO  USA

Reply via email to