Thank you all for the very informative and insightful responses. I
think I've got a pretty good handle on it now and I am going to move
forward in my "Design Pattern Safari" journey.
-Aaron
On 11/16/06, Dave Watts <[EMAIL PROTECTED]> wrote:
> > ColdFusion is s dynamic that when you talk about
> ColdFusion is s dynamic that when you talk about things
> that "relate" to other languages, it is more in philosophy
> than practice.
> When I say "Constant" I don't mean a value that never
> changes, I mean a value that should not be changed by the
> user. I mean a value that does not ch
> I lost your reasoning somewhere down the lines. I understand
> that using THIS inside a component causes it to be
> self-documenting by default in CF while using VARIABLES does
> not. However, it sounds like you are saying the opposite. Are
> you advocating the VARIABLES scope or the THIS sco
MAIL PROTECTED]
Sent: Thursday, November 16, 2006 2:06 PM
To: CF-Talk
Subject: RE: VARIABLES v. THIS in Bean Object
> You have to think about what the two scope need to accomplish. Do you
> need to "hide" the data? Does data need to be accessible. Many classes
> have constants
Dave,
I lost your reasoning somewhere down the lines. I understand that
using THIS inside a component causes it to be self-documenting by
default in CF while using VARIABLES does not. However, it sounds like
you are saying the opposite. Are you advocating the VARIABLES scope or
the THIS scope?
-A
> You have to think about what the two scope need to
> accomplish. Do you need to "hide" the data? Does data need to
> be accessible. Many classes have constants (ex.
> Paper.A4_LAYOUT). These are clearly not private and would be
> stored in the THIS scope. However, if you want to encapsulate
Still making your way there, Ben? I just read another post on your
site about security where you expose the potential dangers of having
access to the THIS scope. After reading it, I understood the
differences between the THIS and VARIABLES scope but thought, man, Ben
must have a good gasp of OOP an
This is golden:
http://ray.camdenfamily.com/downloads/cfcscopes.pdf
I have it pinned up on my wall.
~Brad
-Original Message-
From: Aaron Roberson [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 16, 2006 11:05 AM
To: CF-Talk
Subject: VARIABLES v. THIS in Bean Object
> While I was coding my bean with the THIS scope I was
> wondering why go through the hassle if I can just get and set
> the values directly. Now that I realize the difference
> between THIS and VARIABLES scope, I still think it is a
> little odd to bother with a bean at all if you use the THIS
Or just go with this safe rule: Make everything private first and allow
public access as needed
If you need to expose private data to the public, use an accessor to
retrieve it. I would not recommend just any process to use use the "this"
scope.
Only time "this" is functional is when returning
> A lot of people will say "NEVER" use the 'this' scope. But I
> say if one understands the differences between the
> 'variables' scope and the 'this' scope (how the former is
> private and the latter is public) and code accordingly, I say
> it is a development choice on which scope one uses.
al Message-
From: Aaron Roberson [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 16, 2006 12:05 PM
To: CF-Talk
Subject: VARIABLES v. THIS in Bean Object
Along with many others, I am finally making my journey through the
"Object Safari" and after much too long I am finally begi
While I was coding my bean with the THIS scope I was wondering why go
through the hassle if I can just get and set the values directly. Now
that I realize the difference between THIS and VARIABLES scope, I
still think it is a little odd to bother with a bean at all if you use
the THIS scope.
I am
> Along with many others, I am finally making my journey
> through the "Object Safari" and after much too long I am
> finally beginning to get it. The proverbial light is blinking
> and I am starting to see the forest. For a while I was trying
> to look at the forest from the trees, but I didn'
A lot of people will say "NEVER" use the 'this' scope. But I say if one
understands the differences between the 'variables' scope and the 'this' scope
(how the former is private and the latter is public) and code accordingly, I
say it is a development choice on which scope one uses.
-
Along with many others, I am finally making my journey through the
"Object Safari" and after much too long I am finally beginning to get
it. The proverbial light is blinking and I am starting to see the
forest. For a while I was trying to look at the forest from the trees,
but I didn't know that I
16 matches
Mail list logo