This looks like the work of either Mike Nimer or Ray Camden... One of 
them, I can't remember which, is very fond of the 
cfparam-to-initialize-this-attributes idiom.

I personally don't like it(!) because, to me, cfparam says "I'm being 
passed some parameters and I'll validate their types and set defaults 
for omitted ones" whereas for 'this.' attributes, you clearly are not 
being passed any parameters and, as you correctly observe, none of them 
will exist. I'd just use cfset instead.

I'd also be suspicious of using 'this.' since it's publicly accessible 
(and I don't think I'd want client code to be able to modify userid!).

On Saturday, Mar 15, 2003, at 15:17 US/Pacific, [EMAIL PROTECTED] 
wrote:

> I've been digging into the Pet Market this weekend, and I'm hoping
> if anyone can shed some light on the reasoning behind the way they
> chose to initialize the cfc's. Specifically the user.cfc which is
> instantiated in the application.cfm, has constructor code that looks
> like this.
>
> <cfparam name="this.userid" default="#createuuid()#">
> <cfparam name="this.familyname" default="">
> <cfparam name="this.givenname" default="">
> <cfparam name="this.phone1" default="">
> <cfparam name="this.email" default="">
> etc...
>
> My question is why use cfparam if the constructor code is only going
> to be run when the cfc is first instantiated? None of the properties
> are going to exist yet anyway... What am I missing here?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to