> This creates a conflict... to my surprise. It shouldn't in my mind.
> (Must be my old VB background here... but that wasn't an issue then was
> it? I haven't done any .NET... just way back at VB6 and before.) I have
> been doing CF since version 4 and it seemed logical to assume that
> attributes and methods shouldn't be conflicting. (Which it does
> apparently.) Is this an issue in Java... what is the problem with this?

Visual Basic 6 and VBScript do not allow you to pass around references to
functions. ColdFusion, as well as Jscript/JavaScript, does. As far as I
know, this has not changed with ColdFusion MX 7, Visual Basic.Net, or
Jscript.Net. 
 
As a result, with ColdFusion, you can treat UDF references as you would any
other variable. You can place them in structures and, more importantly, in
shared scopes (e.g. application, session, request, etc.).

As far as I know, the behavior you're seeing is a combination of this and
the fact that (most) scopes can be treated as structures (most of the time).
The "this" scope, which refers to a component's public interface, is no
different. Your code could have just as easily been written like this:

  <cfset structInsert(this, local.columnName,
    variables.query[local.columnName][variables.currentRow], true)>

You could even define your methods as private, extend your component with
another component, copy the methods in question to the "this" scope and, in
effect, make the private methods public. That's one of the reasons that
"private" should not be used for security purposes. Of course, there are
other ways to accomplish the same thing. I'm just illustrating a point.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]

Reply via email to