approach 3:
create getters/setters in CFC for all fields. Values are set either
directly into variables scope, or into an instance struct within the
variables scope.
CF code would then be: objContacts.setName("Joseph");
The data members should definitely be in the variables scope and not
the this scope, and I don't like the dollar sign nomenclature because to
me it means an inner class (and to CF when working w/ java objects).
-Dave
>>> [EMAIL PROTECTED] 7/30/2004 11:45:17 AM >>>
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
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]