As an aside, and taking a cue from JavaScript objects you can also use the
init method as data to do a type comparison of two CFCs (since functions in
CFC are also data).  In other words:

Cfif myFirstCFC.init EQ myOtherCFC.init

Will return "true" if the two CFCs were instantiated from the same component
definition.

Of course to do this all the components need an init() method (or, actually,
any method universal to all your CFCs).

Jim Davis

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Sean A Corfield
Sent: Tuesday, March 16, 2004 7:05 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Returing "THIS" from init(), WAS: RFC, CFC Best
Practices

On Mar 16, 2004, at 3:55 PM, Matt Liotta wrote:
> Well then when it appears in default constructors don't you think it 
> is better suited there then in the pseudo-constructor area?

As the CFMX coding guidelines say:

"The use of pseudo-constructor initialization should be kept to a 
minimum and  instead an init() method  should be used to initialize the 
component - see Good  Practice: Constructors."

The "Good Practice: Constructors" section says:

"All components should define a method called init() that initializes  
the instance, even if the body of the method is empty, i.e., the 
initialization  doesn't do  anything."

> Clearly the following wouldn't fit.
>
> new /fully/qualified/identifier

We agree on that.

> Where as the following would.
>
> new fully.qualified.identifier

Well, we don't agree on that...

> Which I think this a great reason to lose the ability to use a path to 
> specify a CFC.

...although I do agree with you there - I don't like the path specifier 
for CFCs either!

Regards,
Sean

----------------------------------------------------------
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]



----------------------------------------------------------
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]

Reply via email to