I've just read through the CFC Theory thread from last fall, and I don't understand
why noone ever suggested this:
Why not just create the private scope? i.e.
cfcomponent
cfset private.anyvar = 'hidden value'
/cfcomponent
Or use pr.anyvar for less typing. Or self.anyvar, or anything
-
From: Brad Howerter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:31 PM
To: CF-Talk
Subject: CFC theory
I've just read through the CFC Theory thread from last fall,
and I don't understand why noone ever suggested this:
Why not just create the private scope? i.e.
cfcomponent
is the Force, and a powerful ally it is. - Yoda
-Original Message-
From: Brad Howerter [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:31 PM
To: CF-Talk
Subject: CFC theory
I've just read through the CFC Theory thread from last fall,
and I don't understand why noone
Yep, and that's what I would recommend as well.
-RC
If you use private as your scope, you could dump it with
cfdump var=#private#.
People know they can do this - the problem I think is simply the
documentation. I think people wanted this concept (of the
private scope
and This) to
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 01, 2002 12:27 PM
To: CF-Talk
Subject: Re: CFC theory
On Sunday, September 1, 2002, at 08:27 , Jeffry Houser wrote:
I almost skipped over this post because it was all quotes. ( I
imagine
Let's see: CFCs have given us a this scope which is *public*;
instance
variables can't be made private except by the kludge of using an
unnamed
scope. We have CFCs presented as OO, but which has no concept of
super.
We have no overloading of methods in CFCs.
I don't really think making
At 09:27 AM 9/1/2002 -0700, you wrote:
3. Is the data created inside a component protected from outside
forces? I'm a little grey on this one. You can create component specific
variables using the this scope.
this scope is public, the unnamed scope is private so this gets a YES.
:hmm: That is interesting. I don't like un-named scopes. I wish
someone at Macromedia took a little time to document this stuff.
I thought the variable was automatically put into the this scope.
I
have to agree with Hal on this one. That is a kludge. The scope
should
have a name.
-Talk
Subject: RE: CFC theory
snip
Actually you can scope private variables using the variables scope.
Although there is a bug associated with using the variables scope, so it
is better to use no scope for now.
/snip
__
Your ad
Subject: RE: CFC theory
snip
Actually you can scope private variables using the variables scope.
Although there is a bug associated with using the variables scope, so it
is better to use no scope for now.
/snip
__
Signup
At 10:47 AM 9/2/2002 -0700, you wrote:
:hmm: That is interesting. I don't like un-named scopes. I wish
someone at Macromedia took a little time to document this stuff.
I thought the variable was automatically put into the this scope.
I
have to agree with Hal on this one. That is
To: CF-Talk
Subject: RE: CFC theory
snip
Actually you can scope private variables using the variables scope.
Although there is a bug associated with using the variables scope, so
it
is better to use no scope for now.
/snip
Then what is overloading? And how is it different than overriding?
Overloading is where you have more than one method with the same name,
but different signatures. By signature I mean the number and type of
parameters as well as the return type. Different languages implement
different
12:24 PM
To: CF-Talk
Subject: RE: CFC theory
Let's see: CFCs have given us a this scope which is *public*;
instance
variables can't be made private except by the kludge of using an
unnamed
scope. We have CFCs presented as OO, but which has no concept of
super.
We have no overloading of methods
1:29 PM
To: CF-Talk
Subject: Re: CFC theory
At 09:27 AM 9/1/2002 -0700, you wrote:
3. Is the data created inside a component protected from outside
forces? I'm a little grey on this one. You can create component
specific variables using the this scope.
this scope is public
) at
www.techspedition.com
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:48 PM
To: CF-Talk
Subject: RE: CFC theory
I agree with you completely, Matt. I object to CFCs using the this
scope and making this public. It removes virtually all
The term, OO, is not merely an imprimatur that marketing can annoint a
product with if it is to mean anything at all. We should be able to
expect that this is a private scope, that CFCs would have
overloadable
methods, overloadable constructors, etc.
I disagree with adding overloadable
Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 12:53 PM
To: CF-Talk
Subject: RE: CFC theory
Overloading means that a method or constructor can
Or perhaps part of the issue is the flavor of OO Macromedians are used
to. As Alan Kay, one of the creators of Smalltalk once said, I invented
the term 'object oriented' and I can tell you I did NOT have C++ in
mind.
Hal Helms
Preorder Discovering ColdFusion Components (CFCs) at
: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 12:58 PM
To: CF-Talk
Subject: RE: CFC theory
Another problem with the unnamed scope is that you can't have this:
cfset score = arguments.score
That puts a needless restriction that instance variables be named
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:53 PM
To: CF-Talk
Subject: RE: CFC theory
I disagree. What you are suggesting is a lame use of overloading that
could easily be handled by an if statement. Simply make the address
parameter
://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 1:09 PM
To: CF-Talk
Subject: RE: CFC theory
Well, that's exactly what we have to do because the folks at
Macromedia
OK, thanks to you both.
--Matt--
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 12:18 PM
To: CF-Talk
Subject: RE: CFC theory
Correct
Matt Liotta
President CEO
Montara Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F
On Monday, September 2, 2002, at 10:28 , Jeffry Houser wrote:
:hmm: That is interesting. I don't like un-named scopes. I wish
someone at Macromedia took a little time to document this stuff.
I did, it's on my blog :) But I know what you mean! The bug is that
'variables' scope inside a
On Monday, September 2, 2002, at 12:52 , Hal Helms wrote:
Not having this ability means
that we have to resort to all sorts of workarounds while a standard OO
implementation of overloading would eliminate this problem.
Overloading has *nothing* to do with OO! Overloading is a language feature
On Monday, September 2, 2002, at 01:00 , Hal Helms wrote:
Or perhaps part of the issue is the flavor of OO Macromedians are used
to. As Alan Kay, one of the creators of Smalltalk once said, I invented
the term 'object oriented' and I can tell you I did NOT have C++ in
mind.
Java is often
On Monday, September 2, 2002, at 01:08 , Hal Helms wrote:
Well, that's exactly what we have to do because the folks at Macromedia
decided not to offer overloading. But programmers shouldn't have to
resort to conditional code to make up for the language's deficits.
Overloading is NOT
Components (CFCs) at
www.techspedition.com
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:54 PM
To: CF-Talk
Subject: RE: CFC theory
Why doesn't your code work? Seems perfectly acceptable to me assuming
you have already declared score outside
for method arguments.
Hal Helms
Preorder Discovering ColdFusion Components (CFCs) at
www.techspedition.com
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 4:07 PM
To: CF-Talk
Subject: RE: CFC theory
What? If you use an if statement
://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 1:30 PM
To: CF-Talk
Subject: RE: CFC theory
Look at this code, Matt, for a Quandry.cfc:
cfcomponent hint=I am
On Monday, September 2, 2002, at 12:48 , Hal Helms wrote:
I agree with you completely, Matt. I object to CFCs using the this
scope and making this public.
Why? this scope in Java is for public data members (as well as private
data members). this scope in C++ is for public data members (as
To: CF-Talk
Subject: Re: CFC theory
On Monday, September 2, 2002, at 12:52 , Hal Helms wrote:
Not having this ability means
that we have to resort to all sorts of workarounds while a standard OO
implementation of overloading would eliminate this problem.
Overloading has *nothing* to do with OO
) at
www.techspedition.com
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:54 PM
To: CF-Talk
Subject: RE: CFC theory
Why doesn't your code work? Seems perfectly acceptable to me assuming
you have already declared score outside
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 1:35 PM
To: CF-Talk
Subject: RE: CFC theory
I was not meaning to imply that overloading should only be used for
different number of variables
On Monday, September 2, 2002, at 01:37 , Hal Helms wrote:
True, Sean, but not having overloading in an OO language seems baffling,
at least to me.
One thing I'll say about overloading - it can be frighteningly complicated
and very difficult for even fairly good C++ (or Java) programmers to
Why? this scope in Java is for public data members (as well as
private
data members). this scope in C++ is for public data members (as well
as
private data members).
I believe the this keyword in Java is simply a reference to itself in
the context of an instance.
-Matt
[mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 4:38 PM
To: CF-Talk
Subject: Re: CFC theory
All this simply argues that reusing the same name in different scopes is
rightly considered bad practice. Note that this collision is *exactly*
the
same as in Java where arguments scope takes
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 4:32 PM
To: CF-Talk
Subject: Re: CFC theory
On Monday, September 2, 2002, at 12:48 , Hal Helms wrote:
I agree with you completely, Matt. I object to CFCs using the this
scope and making
]
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 1:57 PM
To: CF-Talk
Subject: RE: CFC theory
But CF does type checking for return types and argument types. It
allows
polymorphism by checking the type, so why can't we expect it to know
enough
Discovering ColdFusion Components (CFCs) at
www.techspedition.com
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 4:59 PM
To: CF-Talk
Subject: RE: CFC theory
Oh no! CF does not do type checking as there are no types. CF does
provide a built
On Monday, September 2, 2002, at 01:56 , Hal Helms wrote:
But CF does type checking for return types and argument types. It allows
polymorphism by checking the type, so why can't we expect it to know
enough to sort out the type of the argument passed to it?
What has polymorphism got to do
Montara Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 2:11 PM
To: CF-Talk
Subject: RE: CFC theory
I think the problem is that CF
On Monday, September 2, 2002, at 01:54 , Hal Helms wrote:
I can't agree that this is the same as in Java. In Java, I can define an
instance variable as private and then set it to an identically named
argument passed into a method.
Only if you explicitly qualify the instance variable with
Yes, it would be nice if cfproperty affected 'this' scope variables.
But
it doesn't. cfproperty just defines class metadata.
CF behaves a particular way. Let's just get over, OK?
Nah, let's keep throwing it in Macromedia's face and wait for them to
change the way cfproperty works. ;)
of real ones.
Hal Helms
Preorder Discovering ColdFusion Components (CFCs) at
www.techspedition.com
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 5:08 PM
To: CF-Talk
Subject: Re: CFC theory
On Monday, September 2, 2002, at 01:56 , Hal
On Monday, September 2, 2002, at 01:54 , Hal Helms wrote:
I can't agree that this is the same as in Java. In Java, I can define an
instance variable as private and then set it to an identically named
argument passed into a method.
Only if you explicitly qualify the instance variable with
Pete Freitag wrote:
I think the this scope was a poor name choice, I would expect the this
keyword to point to, or reference my object as it does in C++ or Java. I'm
not saying that CFC's should be exactly like Java or C++ classes, but it
would have led to less confusion if this was named
]
-Original Message-
From: Pete Freitag [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 2:35 PM
To: CF-Talk
Subject: RE: CFC theory
On Monday, September 2, 2002, at 01:54 , Hal Helms wrote:
I can't agree that this is the same as in Java. In Java, I can
define
Polymorphism is based on types, Sean. I won't return your insult and
suggest that you don't know this. I'm suggesting that if CF knows
enough
about types to implement polymorphic behavior that it might know
enough
to allow for overloading.
I disagree and showed in another email that CF's
Yes I know that that works, but strictly speaking salary is not private when
it is in the variables scope, due to the bug.
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 5:32 PM
To: CF-Talk
Subject: RE: CFC theory
That is not true as I
://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Pete Freitag [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:05 PM
To: CF-Talk
Subject: RE: CFC theory
Yes I know that that works, but strictly speaking salary is not
private
when
At 12:50 PM 9/2/2002 -0700, you wrote:
The term, OO, is not merely an imprimatur that marketing can annoint a
product with if it is to mean anything at all. We should be able to
expect that this is a private scope, that CFCs would have
overloadable
methods, overloadable constructors, etc.
: [EMAIL PROTECTED]
-Original Message-
From: Jeffry Houser [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:07 PM
To: CF-Talk
Subject: RE: CFC theory
At 12:50 PM 9/2/2002 -0700, you wrote:
The term, OO, is not merely an imprimatur that marketing can
annoint
On Monday, September 2, 2002, at 02:30 , Hal Helms wrote:
Polymorphism is based on types, Sean. I won't return your insult and
suggest that you don't know this. I'm suggesting that if CF knows enough
about types to implement polymorphic behavior that it might know enough
to allow for
At 03:18 PM 9/2/2002 -0700, you wrote:
Well you are of course welcome to have that opinion, but that doesn't
really help this thread.
Yeah, I realized after I sent it (and saw the 50 other posts on this same
topic) I was wasting bandwidth and offered nothing new. :)
--
Jeffry Houser |
Anything placed in the variables scope is private; bug or not.
Depends on how you look at it, sure it's private in that you can't access
cfcInstance.salary
But you could do something like this...
cfset variables.salary = foo.getSalary()
cfset variables.salary = DollarFormat(variables.salary)
At 01:19 PM 9/2/2002 -0700, you wrote:
On Monday, September 2, 2002, at 10:28 , Jeffry Houser wrote:
:hmm: That is interesting. I don't like un-named scopes. I wish
someone at Macromedia took a little time to document this stuff.
I did, it's on my blog :) But I know what you mean! The
://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
-Original Message-
From: Pete Freitag [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 3:40 PM
To: CF-Talk
Subject: RE: CFC theory
Anything placed in the variables scope is private; bug
202.797.6570 (direct line)
www.figleaf.com
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 18:19
To: CF-Talk
Subject: RE: CFC theory
Well you are of course welcome to have that opinion, but that doesn't
really help this thread. IMHO
Subject: RE: CFC theory
The variable is private. However, when you use the getSalary method you
return a reference to the private variable. This is the same in Java if
you declare a variable as private and have a public getter that
returns a reference to it.
Matt Liotta
President CEO
Montara
On Monday, September 2, 2002, at 03:29 , Jeffry Houser wrote:
The book is Object Oriented Programming by Timothy Budd. It is an older
one (1991 if memory serves me).
He releases an update every few years. The latest edition is October 2001.
It would be interesting to see how much it
.
-pete
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 6:38 PM
To: CF-Talk
Subject: RE: CFC theory
The variable is private. However, when you use the getSalary method you
return a reference to the private variable
PROTECTED]]
Sent: Monday, September 02, 2002 4:05 PM
To: CF-Talk
Subject: RE: CFC theory
I don't think you saw what I was getting at, here is a very explicit
example:
cfset foo = CreateObject(component, Salary)
cfset variables.salary = 123
cfoutput#foo.getSalary()#/cfoutput
getSalary
-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 4:05 PM
To: CF-Talk
Subject: Re: CFC theory
Yes, these examples exploit the (well-publicized) bug that variables
scope
is broken in components and instead refers to the caller's variables
scope.
When we fix
]]
Sent: Monday, September 02, 2002 4:05 PM
To: CF-Talk
Subject: RE: CFC theory
I don't know how more explicit I can get. Your getX method is
returning
a reference to a private data member. Once you have a reference there
is
nothing stopping you from changing the private data. Again
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 7:05 PM
To: CF-Talk
Subject: RE: CFC theory
I don't know how more explicit I can get. Your getX method is returning
a reference to a private data member. Once you have a reference there is
nothing
not have applied.
-pete
-Original Message-
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 02, 2002 7:17 PM
To: CF-Talk
Subject: RE: CFC theory
Whoops! I was a little too quick with this email. The Java code should
be as follows.
public class Salary
{
private
At 04:00 PM 9/2/2002 -0700, you wrote:
I can't really speak to Budd's books but OO has moved on a lot since '91..
.
I doubt that the motivating concepts behind OO has changed. Languages
change, and implementation details are different in each language, but the
concepts don't really change
I almost skipped over this post because it was all quotes. ( I imagine
that was because the list was bouncing stuff for a bit).
At 08:04 PM 8/31/2002 -0700, you wrote:
On Friday, August 30, 2002, at 10:35 , Jeffry Houser wrote:
I think this is too good of a topic to pass up, and I
On Sunday, September 1, 2002, at 08:27 , Jeffry Houser wrote:
I almost skipped over this post because it was all quotes. ( I imagine
that was because the list was bouncing stuff for a bit).
Yeah, sorry about that.
3. Is the data created inside a component protected from outside
forces?
On Friday, August 30, 2002, at 10:35 , Jeffry Houser wrote:
I think this is too good of a topic to pass up, and I haven't seen any
other responses, so.. I'll give it a shot.
Well, I was drafting a reply but didn't have time to finish it... and
you'
ve actually said most of what I was
I think this is too good of a topic to pass up, and I haven't seen any
other responses, so.. I'll give it a shot.
At 10:11 AM 8/29/2002 -0400, you wrote:
I'm trying to get my head around some good practices for using CFCs. I
suppose it's old hat to those with OO backgrounds, but let's
I'm trying to get my head around some good practices for using CFCs. I
suppose it's old hat to those with OO backgrounds, but let's discuss a
hypothetical application.
Let's say you're building an e-commerce application. Among the various data
you have users and shipping addresses. Users can
73 matches
Mail list logo