I think you mean putting code within the CFCOMPONENT tags, but outside
of any CFFUNCTION tags.

Yes, this is commonly referred to as the "unnamed scope" in CFCs, and is the only true private scope (contrary to some posts on cf-talk and elsewhere, the "this" scope is not private as in Java).


The code will be executed when each component is instantiated or
invoked, but I'm not sure if it will actually run on the execution of
each method within that component.

It only gets executed on the first invocation of the object, not with each method call.


You are probably better off having another method in your component (or
somewhere) that is specifically called in each method rather than
relying on the "constructor".  Who knows, that behaviour could change in
a future version of CF.

Relying on unintended features has bitten people in the past (i.e., accessing the CF factory directly, which was subsequently closed). I've personally always found it best to rely on existing product features (including both CF features and Java features) rather than community-promoted "hacks," as that allows me to figuratively point the finger at Macromedia if the functionality is later changed or deprecated.


Regards,
Dave.

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to