> Would it really be worth it/practical for me to create 40 methods to
populate a registration form?
No. If your form is just updating specific fields in a database then its
extra effort (maybe). If you are absolutely sure your application or your
database won't change then don't create 40 methods. But say for instance
your original requirement called for a single name field
<input type="text" name="name">
and you have a single name field in your database. Down the line say your
client or company has a requirement for 2 names in the database, first and
last. If you had getter and setter methods, you could then change them and
not have to change every point in your application that accesses that
information. For instance your setter method might change to
<cfset fname = left(arguments.name,find(" ",arguments.name)) />
<cfset lname = right(arguments.name,len(arugments.name)-find("
",arguments.name) />
and your getter method would become
<cfreturn fname+' '+lname />
Thats it, two small code changes. No where else in your application
requires any changes.
>Why is returning a structure a "hack"?
You're exposing the internal variables of the object. I'm not saying don't
do it absolutely. I'm doing the exact same thing when in makes sense.
Just be aware that the preferred method would be to always use getter and
setter methods to access attributes.
Jason Cronk
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the mailserver that powers this list at
http://www.houseoffusion.com/banners/view.cfm?bannerid=17
Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6747
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54