Re: difference between cfproperty and variables defined with This scope

2010-02-03 Thread Aaron Neff

Sry, that should've read: "In short, variables created via the 
cfproperty|property-generated setters (in CF9) are private-to-the-CFC. And 
variables in the this scope are public-to-the-CFC."

> In short, variables created via the cfproperty|property-generated 
> setters (in CF9) are private-to-the-CFC. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330398
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: difference between cfproperty and variables defined with This scope

2010-02-03 Thread Aaron Neff

Hi fun and learning,

In short, variables created via the cfproperty|property-generated setters (in 
CF9) are private-to-the-CFC.

I recommend reading these docs:

cfproperty|property: 
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7e0b.html

Implicit Get and Set Functions: 
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0999c-7ff5.html#WS1E722CDD-3AA0-4e17-86DB-EF6D12FC6750

Also, please note:
- "Component properties you assign with the set method are in the Variables 
scope that is private to the CFC. You can get or reset the properties only by 
calling get or set methods."
- "The default attribute has no effect on the property and does not set an 
initial property value"
- "A direct assignment statement, such as myCFC.MyProp=27 creates a standard 
This scope variable in the CFC, even if you specify the property in a 
cfproperty tag. The This scope variable is independent of the properties that 
you access using the set and get methods. In fact, you can have a This scope 
variable with the same name as a property that you access using the set and get 
methods."

I wanted to mention those notes, just to clarify that (even in CF9) using 
cfproperty|property alone does not create an initial variable. In CF9, a 
private (variables-scope), not public (this-scope), variable can be created 
using the auto-generated setter (created by cfproperty|property, if 
accessors="true" on the component).

Thanks!,
-Aaron Neff

===

> Hi All,
> 
> Can anyone please tell me the difference between cfproperty tag and 
> variables defined using this scope. Both are used to define CFC 
> properties? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330397
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: difference between cfproperty and variables defined with This scope

2010-02-03 Thread fun and learning

>> CF 9 changed this significantly. With CF 9, using CFPROPERTY actually
>> creates a public variable in addition to creating documentation. In
>> addition to that, it also "creates" accessors and mutators (setters
>> and getters). It doesn't actually generate visible code in your CFC,
>> but those methods will be available for you to call without you
>> actually writing them.
>
>To clarify a bit further, CF9 added an accesssors="(yes|no)" attribute
>to the creation of a CFC. If your CFC is defined as Persistent (using
>the new ORM functionality) this defaults to Yes and those setFoo and
>getFoo functions will be created implicitly. If you do not set the
>persistent flag, the value of accessors defaults to No.
>
>Then on individual cfproperty tags you can also specify whether to
>create an accessor and/or mutator for that particular property.
>
>I'm not sure what would happen if you set accessors="no" on your cfc
>and then declared the cfproperty tags with implicit accessor/mutator
>turned on. I'm guessing that it would ignore the attributes in the
>cfproperty tags and the variables/functions would not be created.
>
>Cheers,
>Judah

Thanks a lot for the explanation 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330394
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: difference between cfproperty and variables defined with This scope

2010-02-02 Thread Judah McAuley

On Tue, Feb 2, 2010 at 11:21 AM, Dave Watts  wrote:
> CF 9 changed this significantly. With CF 9, using CFPROPERTY actually
> creates a public variable in addition to creating documentation. In
> addition to that, it also "creates" accessors and mutators (setters
> and getters). It doesn't actually generate visible code in your CFC,
> but those methods will be available for you to call without you
> actually writing them.

To clarify a bit further, CF9 added an accesssors="(yes|no)" attribute
to the creation of a CFC. If your CFC is defined as Persistent (using
the new ORM functionality) this defaults to Yes and those setFoo and
getFoo functions will be created implicitly. If you do not set the
persistent flag, the value of accessors defaults to No.

Then on individual cfproperty tags you can also specify whether to
create an accessor and/or mutator for that particular property.

I'm not sure what would happen if you set accessors="no" on your cfc
and then declared the cfproperty tags with implicit accessor/mutator
turned on. I'm guessing that it would ignore the attributes in the
cfproperty tags and the variables/functions would not be created.

Cheers,
Judah

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330361
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: difference between cfproperty and variables defined with This scope

2010-02-02 Thread Dave Watts

> Can anyone please tell me the difference between cfproperty tag and variables 
> defined using this scope. Both are used to define
> CFC properties?

The answer to this is a bit complicated, and version-dependent.

If you're using CF 8 or earlier, the CFPROPERTY tag does nothing but
define metadata, as Steven mentioned. This is not especially useful
except in a couple of narrow cases. Using CFPROPERTY will show the
variable in your automatically-generated documentation (human-readable
and WSDL), but it doesn't actually create the variable - you have to
do that separately. If you only create the variable and don't use
CFPROPERTY, you don't see it in the documentation even though it's
actually there.

CF 9 changed this significantly. With CF 9, using CFPROPERTY actually
creates a public variable in addition to creating documentation. In
addition to that, it also "creates" accessors and mutators (setters
and getters). It doesn't actually generate visible code in your CFC,
but those methods will be available for you to call without you
actually writing them.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330352
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: difference between cfproperty and variables defined with This scope

2010-02-02 Thread DURETTE, STEVEN J (ATTASIAIT)

Opps.

I used   didn't put variables in this instance.  I
wanted them to only be part of the cfc.

Steve


-Original Message-
From: DURETTE, STEVEN J (ATTASIAIT) 
Sent: Tuesday, February 02, 2010 1:50 PM
To: cf-talk
Subject: RE: difference between cfproperty and variables defined with
This scope


According to the docs, cfproperty only sets Metadata.  I just did this
recently and even though I could set the initial values I had trouble
changing them and using them just inside the cfc.

I resorted to   Notice that there is no var
in there.  If the variables are outside of a function, you cannot use
var.

Steve


-Original Message-
From: fun and learning [mailto:funandlrnn...@gmail.com] 
Sent: Tuesday, February 02, 2010 1:39 PM
To: cf-talk
Subject: difference between cfproperty and variables defined with This
scope


Hi All,

Can anyone please tell me the difference between cfproperty tag and
variables defined using this scope. Both are used to define CFC
properties? 





~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330350
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: difference between cfproperty and variables defined with This scope

2010-02-02 Thread DURETTE, STEVEN J (ATTASIAIT)

According to the docs, cfproperty only sets Metadata.  I just did this
recently and even though I could set the initial values I had trouble
changing them and using them just inside the cfc.

I resorted to   Notice that there is no var
in there.  If the variables are outside of a function, you cannot use
var.

Steve


-Original Message-
From: fun and learning [mailto:funandlrnn...@gmail.com] 
Sent: Tuesday, February 02, 2010 1:39 PM
To: cf-talk
Subject: difference between cfproperty and variables defined with This
scope


Hi All,

Can anyone please tell me the difference between cfproperty tag and
variables defined using this scope. Both are used to define CFC
properties? 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330349
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


difference between cfproperty and variables defined with This scope

2010-02-02 Thread fun and learning

Hi All,

Can anyone please tell me the difference between cfproperty tag and variables 
defined using this scope. Both are used to define CFC properties? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330348
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: [CFCDEV] Application.cfc and this scope

2007-08-06 Thread Tom Chiverton
On Friday 03 Aug 2007, [EMAIL PROTECTED] wrote:
> Or any alternative way to set "this" scope variables which is available
> in Application.cfc without having any Application.cfc?

A server-wide mapping in the administrator, for instance ?

-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.


~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285451
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Application.cfc and this scope

2007-08-03 Thread Oğuz_Demirkapı
Hi,

 

Please do not ask why but I am just trying to set a parameter which is normally 
defined in Application.cfc this scope, in normal CFM page.

 

This parameter is new ColdFusion application layer mapping feature.

 

When we need to define an application layer mapping we can use following 
structure in Application.cfc file.

 









 

But in my case I do not want to use Application.cfc file. The question is now 
how I can create a parameter which would be the same with this mappings 
structure?

 

Can I use CFCProxy setThisScope() method for this purpose?

 





 

Or any alternative way to set “this” scope variables which is available in 
Application.cfc without having any Application.cfc?

 

As I said please do not ask why not using direct Application.cfc. J

 

Thanks in advance.

 

 

 

Sincerely,

 

Oğuz Demirkapı

 

Sr. Developer | TeraTech

http://www.teratech.com

 



~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285362
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFCs and the THIS scope

2007-03-09 Thread Ian Skinner
I didn't gather that you also cannot invoke methods of persistently scoped 
components via form or url.

Not directly you can't.  You could invoke persistently scoped objects from 
within the transitional one created when called from the form, with some 
caveats.

I doubt many would consider this a great idea, but it is theoretically possible.


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Sudoku
|   |   |
-
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272159
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFCs and the THIS scope

2007-03-08 Thread joe smiths
> ...What you are not realizing is that when you 
> post directly to the CFC url by the action property of the form tag, 
> you are creating a new instance of the object...

Bingo. That was indeed my problem. In the docs it is written that you may only 
transiently invoke component methods via form or url, which is fine, but I 
didn't gather that you also cannot invoke methods of persistently scoped 
components via form or url. Which is also fine - it's the not knowing that 
kills you.

Thanks again to all contributors.

~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272096
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFCs and the THIS scope

2007-03-08 Thread Rick Root
On 3/8/07, Russ <[EMAIL PROTECTED]> wrote:
>
> Isn't web services all about posting to CFC's?  Am I missing something
> here?


If you think that's the same thing, then yes, you are =)


-- 
> I'm not certified, but I have been told that I'm certifiable...
> Visit http://www.opensourcecf.com today!


~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272092
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: CFCs and the THIS scope

2007-03-08 Thread Russ
Isn't web services all about posting to CFC's?  Am I missing something here?

Russ

> -Original Message-
> From: Ian Skinner [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 08, 2007 5:32 PM
> To: CF-Talk
> Subject: RE: CFCs and the THIS scope
> 
> Essentially, you should *NOT* ever post to a cfc.
> 
> 
> But I like posting to my cfc's sometimes.  I just understand I am creating
> one-off controller type cfcs when I do this.
> 
> --
> Ian Skinner
> Web Programmer
> BloodSource
> www.BloodSource.org
> Sacramento, CA
> 
> -
> | 1 |   |
> -  Binary Sudoku
> |   |   |
> -
> 
> "C code. C code run. Run code run. Please!"
> - Cynthia Dunning
> 
> Confidentiality Notice:  This message including any
> attachments is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the
> intended recipient, please contact the sender and
> delete any copies of this message.
> 
> 
> 
> 
> 

~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272080
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFCs and the THIS scope

2007-03-08 Thread Ian Skinner
Essentially, you should *NOT* ever post to a cfc.


But I like posting to my cfc's sometimes.  I just understand I am creating 
one-off controller type cfcs when I do this.

--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Sudoku
|   |   |
-
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272079
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFCs and the THIS scope

2007-03-08 Thread Rick Root
Essentially, you should *NOT* ever post to a cfc.

What you do is post the page to itself (or another cfm) and then pass the
arguments to the method like so:



Rick


~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272078
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFCs and the THIS scope

2007-03-08 Thread Josh Nathanson
>Have to admit I find it shocking that a THIS scoped variable cannot be 
>updated within the enclosing component by >using a simple assignment 
>statement...

That would be shocking, but it's not the problem you're having.

Suffice to say that generally speaking, you don't want to post directly to a 
cfc.  The idea is to post to an action page like dostuff.cfm, and then in 
that action page, do what you want with your objects (instantiate, call 
methods, etc.)

In your action page dostuff.cfm you might have:
 

Then to pass your form variable in,
 

Then you should get the desired result:
#tempObj.tableName# should return whatever you passed in above.

Of course since your object is not in the above case scoped into the 
session, it would only be available for the duration of the request.

I won't even get into whether it's ok to use the THIS scope or not.  That is 
one of the most contentious issues when it comes to objects and CF.

-- Josh








- Original Message - 
From: "joe smiths" <[EMAIL PROTECTED]>
To: "CF-Talk" 
Sent: Thursday, March 08, 2007 12:27 PM
Subject: Re: CFCs and the THIS scope


> Wow. Well then, since this.tableName=arguments.tableName will simply never 
> work as intended (as in the update1 method) I will stick to 
> session.temp.tableName=arguments.tableName (as in the update2 method). 
> Have to admit I find it shocking that a THIS scoped variable cannot be 
> updated within the enclosing component by using a simple assignment 
> statement...
>
> Thanks to all for your replies.
>
>>> How would one post to the session scoped temp.cfc via a form?
>>
>>You couldn't, directly. You would have to post to another page, which 
>>could
>>send data to your session object.
>
> 

~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272076
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: CFCs and the THIS scope

2007-03-08 Thread Ian Skinner
Have to admit I find it shocking that a THIS scoped variable cannot be updated 
within the enclosing component by using a simple assignment statement...

Thanks to all for your replies.


It can be done that way.  What you are not realizing is that when you post 
directly to the CFC url by the action property of the form tag, you are 
creating a new instance of the object each and every time, and then assigning 
your values to that newly created instance.

If you go to an action page that can access the already created object in the 
session scope then this line will work just as you desire.

Session.myObject.thisVariable = form.someField

Or if you want to pass the entire form scope.

Session.myObject.thisStruct = form


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Sudoku
|   |   |
-
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272075
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFCs and the THIS scope

2007-03-08 Thread joe smiths
>Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
>into the session scope.

When the cfm is loaded, a session scoped component is instantiated. When the 
update2 form is submitted, the session scoped component property "tableName" is 
updated as expected. The odd part (to me anyway) is that when the update1 form 
is submitted, the assignment "this.tableName=..." fails to update the component 
property "tableName". 

~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272073
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFCs and the THIS scope

2007-03-08 Thread joe smiths
Wow. Well then, since this.tableName=arguments.tableName will simply never work 
as intended (as in the update1 method) I will stick to 
session.temp.tableName=arguments.tableName (as in the update2 method). Have to 
admit I find it shocking that a THIS scoped variable cannot be updated within 
the enclosing component by using a simple assignment statement...

Thanks to all for your replies.

>> How would one post to the session scoped temp.cfc via a form?
>
>You couldn't, directly. You would have to post to another page, which could
>send data to your session object.

~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272072
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: CFCs and the THIS scope

2007-03-08 Thread Dave Watts
> How would one post to the session scoped temp.cfc via a form?

You couldn't, directly. You would have to post to another page, which could
send data to your session object.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272071
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFCs and the THIS scope

2007-03-08 Thread joe smiths
>Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
>into the session scope.

How would one post to the session scoped temp.cfc via a form?

~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272069
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFCs and the THIS scope

2007-03-08 Thread joe smiths
>Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
>into the session scope.

Could you expand on that? 

How would one post to the session scoped temp.cfc via a form? 

~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272067
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFCs and the THIS scope

2007-03-08 Thread Rick Root
Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
into the session scope.

Rick


On 3/8/07, joe smiths <[EMAIL PROTECTED]> wrote:
>
> Given the files below - why does update1() fail to update the cfc
> property?
>
> file TEMP.CFM:
> 
> 
> 
> 
> 
> 
> temp
> 
> 
>
> 
> update1:
> 
>
> "table1">selected>table1
> "table2">selected>table2
> "table3">selected>table3
> 
> 
>
> 
> update2:
> 
>
> "table1">selected>table1
> "table2">selected>table2
> "table3">selected>table3
> 
> 
>
> session.temp.tableName=#session.temp.tableName#
>
> 
> 
> 
>
> file TEMP.CFC:
> 
>
> 
>
> 
> 
>
> 
>
> 
> 
>
> 
> 
>
> 
>
> 
> 
>
> 
>
> 

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272061
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: CFCs and the THIS scope

2007-03-08 Thread Jaime Metcher
Well, it seems to me that both forms are being handled by a new instance of
temp.  update1 stores the value in that new instance, which is garbage
collected some time after the POST request terminates. update2 stores the
value in the prexisting instance which has been placed in the session scope,
which of course hangs around for future reference.

Jaime Metcher

> -Original Message-
> From: joe smiths [mailto:[EMAIL PROTECTED]
> Sent: Friday, 9 March 2007 4:36 AM
> To: CF-Talk
> Subject: CFCs and the THIS scope
>
>
> Given the files below - why does update1() fail to update the cfc
> property?
>
> file TEMP.CFM:
> 
> 
> 
> 
> 
> 
> temp
> 
> 
>
> 
>   update1:
>   
> 
>  "table1">selected>table1
>  "table2">selected>table2
>  "table3">selected>table3
>   
> 
>
> 
>   update2:
>   
> 
>  "table1">selected>table1
>  "table2">selected>table2
>  "table3">selected>table3
>   
> 
>
> session.temp.tableName=#session.temp.tableName#
>
> 
> 
> 
>
> file TEMP.CFC:
> 
>
> 
>
> 
>   
>
>   
>
>   
> 
>
> 
>   
>
>   
>
>   
> 
>
> 
>
> 

~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272058
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


CFCs and the THIS scope

2007-03-08 Thread joe smiths
Given the files below - why does update1() fail to update the cfc property?

file TEMP.CFM:






temp




  update1: 
  

selected>table1
selected>table2
selected>table3
  



  update2: 
  

selected>table1
selected>table2
selected>table3
  


session.temp.tableName=#session.temp.tableName#





file TEMP.CFC:





  

  

  



  

  

  




~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272049
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: When to use the THIS scope for a ColdFusion Component?

2005-08-29 Thread Deanna Schneider
Here's a weird issue we just came across where we had to call a
function with the THIS scope. We have a UDF library that has a
function called "extends" that lets us extend it with our other
specialized udf libraries at runtime. Well, some of the functions call
each other. And, they break unless you call them with
this.functionName().

I'm not really sure why that is. If it's not extended, it works fine.
Go figure. Here's the extends function, FYI:



for (obj in this) {
if (not isDefined("arguments.cfc." & obj))
setvariable("arguments.cfc." & obj, 
evaluate(obj));
}

return arguments.cfc;



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216700
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: When to use the THIS scope for a ColdFusion Component?

2005-08-29 Thread S . Isaac Dealey
> Hi all,

> I am new to OOP, but I know CFML pretty well.

> I started playing with ColdFusion Components a couple of
> years ago and
> I never found a good reason to use the "This" scope.

> Am I missing anything?

I'd recommend not using it except when calling methods of the current
CFC which must always be public in order for the cfc to work as
expected... Though even at that, you can just call the method without
specifying the scope and then it won't break if for some unforseen
reason the method becomes private.


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:21
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: When to use the THIS scope for a ColdFusion Component?

2005-08-29 Thread Michael Dinowitz
This (no pun intended) is a point of conflict within the community. Many say 
never to use it as it breaks encapsulation by allowing access to and 
changing of variables without going through strict interfaces (methods). 
Others will load a component up with data that is expected to be exposed 
through the 'this' scope and expect never to alter it. It all falls down to 
personal taste with my own being to use specific interfaces to get and set 
data.
The only time I use the word 'this' in a component is when I'm persisting 
the component and have to return it from an init method.


> Hi all,
>
> I am new to OOP, but I know CFML pretty well.
>
> I started playing with ColdFusion Components a couple of years ago and
> I never found a good reason to use the "This" scope.
>
> Am I missing anything?
>
> Thanks.
>
> 

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216665
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


When to use the THIS scope for a ColdFusion Component?

2005-08-29 Thread wolf2k5
Hi all,

I am new to OOP, but I know CFML pretty well.

I started playing with ColdFusion Components a couple of years ago and
I never found a good reason to use the "This" scope.

Am I missing anything?

Thanks.

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216663
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Use THIS scope or not?

2005-04-01 Thread Sean Corfield
On Apr 1, 2005 3:46 AM, Mike Kear <[EMAIL PROTECTED]> wrote:
> But in reading the discussions here I thought it was now considered
> poor practice to use the THIS scope in CFCs, and instead using the
> variables scope was the thing to do.

Correct. variables scope is better than this scope in general because
you want to maintain encapsulation (not expose your internal data).

> But in the CF7 documentation, the examples and literature about
> Application.cfc are advocating using the THIS. scope for many things.

Application.cfc is 'special' but it turns out that you can use
variables scope anyway.
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201202
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Use THIS scope or not?

2005-04-01 Thread Ian Skinner
The "this" vs. "variables" argument is ColdFusion's version of the old "public" 
vs. "private" members' argument of Java and other object oriented syntaxes.  

OOP purists tend to advocate an all private/variables methodology.  It 
encapsulates the logic more completely.  But I notice several Java classes that 
do not completely encapsulate all their members.  

So, my take is that it's up to the developer to decide.  There are trade offs 
either way, and if you make a well thought out choice one way or the other 
based on your requirements you are not doing anything wrong.


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

-Original Message-
From: Kerry [mailto:[EMAIL PROTECTED]
Sent: Friday, April 01, 2005 6:26 AM
To: CF-Talk
Subject: RE: Use THIS scope or not?

abstracted from the user: you dont call application.cfc
play book: way of doing something

-Original Message-
From: Mike Kear [mailto:[EMAIL PROTECTED]
....Sent: 01 April 2005 15:12
To: CF-Talk
Subject: Re: Use THIS scope or not?


Thanks for your response Michael.  I have seen endless discussion of
the "this" scope for months.

I wrote the question I did, because I am confused.   Use "this" or
not?   I've read all that stuff, and now I dont know what to do.

What does "... abstracted from the user thus require a different play
book." mean?  What's abstracting mean in this context?  What's a "play
book"?


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month


On Apr 1, 2005 11:27 PM, Michael T. Tangorre <[EMAIL PROTECTED]>
wrote:

> Mike,
>
> This exact question was disucssed earlier this week, check the
archives.
> Application.cfc is an exception to the CFC best practices as a lot of
its
> functionality are abstracted from the user thus require a different
play
> book.
>
> Mike





~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201178
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Use THIS scope or not?

2005-04-01 Thread Dave Carabetta
On Apr 1, 2005 8:27 AM, Michael T. Tangorre <[EMAIL PROTECTED]> wrote:
> 
> This exact question was disucssed earlier this week, check the archives.
> Application.cfc is an exception to the CFC best practices as a lot of its
> functionality are abstracted from the user thus require a different play
> book.
> 

Actually, this isn't even true anymore:

http://www.corfield.org/blog/index.cfm?do=blog.entry&entry=FA9D10F1-FC8A-37BA-F21115AEBB2F5F64

In a nutshell, it turns out you *can* use the variables scope in the
Application.cfc to be consistent with the rest of your CFC practices.

Regards,
Dave.

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201177
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Use THIS scope or not?

2005-04-01 Thread Steve Brownlee
Quick side topic:

This post made me laugh a little because it reminded me of a conversion that
I had with my wife a few days ago.  I admit that I'm a geek and use the whole
gamut of acronyms, pseudonyms and terms that we all love.  She asked me the
usual, "How was your afternoon?" and rather than the usual "Went great!" or
"It was all right" I decided to actually tell her what I did that afternoon
and I needed SOMEONE to hear it because I was especially proud of myself for
overcoming a huge issue.  I'm sure many of you feel the same way sometimes
that you want to talk to someone, ANYONE who could grasp the monumental feat
of intellectual gymnastics that you just performed... So I just had to tell
her.

I spent at leat 20-30 minutes going over the problem, how I diagnosed the
problem, researched it, took a couple of stabs at it and how I solved it.  At
the end she was just staring at me, so I asked "What?", thinking perhaps she
finally understood how earth-shattering this news was.  She responded, "Huh?
Oh, I was just thinking we should paint the hallway yellow instead of green."

Bummer.  I haad my heart set on Sunshine Yellow for that hallway.

-Original Message-
From: Mike Kear [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 01, 2005 9:12 AM
To: CF-Talk
Subject: Re: Use THIS scope or not?

Thanks for your response Michael.  I have seen endless discussion of the
"this" scope for months.

I wrote the question I did, because I am confused.   Use "this" or
not?   I've read all that stuff, and now I dont know what to do.

What does "... abstracted from the user thus require a different play book."
mean?  What's abstracting mean in this context?  What's a "play book"?


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month


On Apr 1, 2005 11:27 PM, Michael T. Tangorre <[EMAIL PROTECTED]> wrote:
 
> Mike,
> 
> This exact question was disucssed earlier this week, check the archives.
> Application.cfc is an exception to the CFC best practices as a lot of its
> functionality are abstracted from the user thus require a different play
> book.
> 
> Mike

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201174
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Use THIS scope or not?

2005-04-01 Thread Kerry
abstracted from the user: you dont call application.cfc
play book: way of doing something

-Original Message-
From: Mike Kear [mailto:[EMAIL PROTECTED]
Sent: 01 April 2005 15:12
To: CF-Talk
Subject: Re: Use THIS scope or not?


Thanks for your response Michael.  I have seen endless discussion of
the "this" scope for months.

I wrote the question I did, because I am confused.   Use "this" or
not?   I've read all that stuff, and now I dont know what to do.

What does "... abstracted from the user thus require a different play
book." mean?  What's abstracting mean in this context?  What's a "play
book"?


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month


On Apr 1, 2005 11:27 PM, Michael T. Tangorre <[EMAIL PROTECTED]> wrote:

> Mike,
>
> This exact question was disucssed earlier this week, check the archives.
> Application.cfc is an exception to the CFC best practices as a lot of its
> functionality are abstracted from the user thus require a different play
> book.
>
> Mike



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201170
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Use THIS scope or not?

2005-04-01 Thread Steve Brownlee
Abstracted = Seperated or hidden
Different Play Book = Different rules apply here

-Original Message-
From: Mike Kear [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 01, 2005 9:12 AM
To: CF-Talk
Subject: Re: Use THIS scope or not?

Thanks for your response Michael.  I have seen endless discussion of the
"this" scope for months.

I wrote the question I did, because I am confused.   Use "this" or
not?   I've read all that stuff, and now I dont know what to do.

What does "... abstracted from the user thus require a different play book."
mean?  What's abstracting mean in this context?  What's a "play book"?


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month


On Apr 1, 2005 11:27 PM, Michael T. Tangorre <[EMAIL PROTECTED]> wrote:
 
> Mike,
> 
> This exact question was disucssed earlier this week, check the archives.
> Application.cfc is an exception to the CFC best practices as a lot of its
> functionality are abstracted from the user thus require a different play
> book.
> 
> Mike

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201169
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Use THIS scope or not?

2005-04-01 Thread Mike Kear
Thanks for your response Michael.  I have seen endless discussion of
the "this" scope for months.

I wrote the question I did, because I am confused.   Use "this" or
not?   I've read all that stuff, and now I dont know what to do.

What does "... abstracted from the user thus require a different play 
book." mean?  What's abstracting mean in this context?  What's a "play
book"?


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month


On Apr 1, 2005 11:27 PM, Michael T. Tangorre <[EMAIL PROTECTED]> wrote:
 
> Mike,
> 
> This exact question was disucssed earlier this week, check the archives.
> Application.cfc is an exception to the CFC best practices as a lot of its
> functionality are abstracted from the user thus require a different play
> book.
> 
> Mike

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201167
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Use THIS scope or not?

2005-04-01 Thread Michael T. Tangorre
> From: Mike Kear [mailto:[EMAIL PROTECTED] 
> I'm confused.  Nothing unusual in that - I'm easily confused.  
> 
> But in reading the discussions here I thought it was now considered
> poor practice to use the THIS scope in CFCs, and instead using the
> variables scope was the thing to do.
> 
> But in the CF7 documentation, the examples and literature about
> Application.cfc are advocating using the THIS. scope for many things.
> 
> So who's right?  Or have I got the wrong end of the stick once more?

Mike,

This exact question was disucssed earlier this week, check the archives.
Application.cfc is an exception to the CFC best practices as a lot of its
functionality are abstracted from the user thus require a different play
book.

Mike



~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201163
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Use THIS scope or not?

2005-04-01 Thread Mike Kear
I'm confused.  Nothing unusual in that - I'm easily confused.  

But in reading the discussions here I thought it was now considered
poor practice to use the THIS scope in CFCs, and instead using the
variables scope was the thing to do.

But in the CF7 documentation, the examples and literature about
Application.cfc are advocating using the THIS. scope for many things.

So who's right?  Or have I got the wrong end of the stick once more?

Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201161
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: this scope

2005-03-30 Thread James Holmes
Yes - all worked as it should using VARIABLES.whatever instead of the THIS
scope. The automatically instantiated Application.cfc can't be accessed from
anywhere in your code anyway, afaik, so the THIS scope isn't terribly useful
in this case.

I blogged this in my nearly empty and more nearly useless Blog, in case
anyone wants to argue the point there:

http://jr-holmes.coldfusionjournal.com/

-Original Message-
From: Sean Corfield [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 31 March 2005 2:19 
To: CF-Talk
Subject: Re: this scope

On Thu, 31 Mar 2005 10:15:29 +0800, James Holmes
<[EMAIL PROTECTED]> wrote:
> Actually, I tried this and the VARIABLES scope worked just as well in 
> Application.cfc.

Really? Oooo, that's good to know...

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200907
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: this scope

2005-03-30 Thread Sean Corfield
On Thu, 31 Mar 2005 10:15:29 +0800, James Holmes
<[EMAIL PROTECTED]> wrote:
> Actually, I tried this and the VARIABLES scope worked just as well in
> Application.cfc.

Really? Oooo, that's good to know...
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200902
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: this scope

2005-03-30 Thread James Holmes
Actually, I tried this and the VARIABLES scope worked just as well in
Application.cfc.

Try it yourself - please correct me if I'm wrong.

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 31 March 2005 5:53 
To: CF-Talk
Subject: Re: this scope

> I've been avoiding the "this" scope in my CFCs after reading several 
> blogs and posts on the topic.  Is that
> still the best practice in CFMX 7?   I ask because all
> the examples I see of application.cfc set and refer to this.name, 
> this.applicationTimeout, etc.

I haven't been able to work with Application.cfc yet (just too busy) though
I wouldn't be surprised if the structure of it requires use fo the this
scope... then again, doesn't all the CF documentation use this?

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200877
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: this scope

2005-03-30 Thread S . Isaac Dealey
> I've been avoiding the "this" scope in my CFCs after
> reading several blogs and posts on the topic.  Is that
> still the best practice in CFMX 7?   I ask because all
> the examples I see of application.cfc set and
> refer to this.name, this.applicationTimeout, etc.

I haven't been able to work with Application.cfc yet (just too busy)
though I wouldn't be surprised if the structure of it requires use fo
the this scope... then again, doesn't all the CF documentation use
this?


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/author/?id=4806
http://www.fusiontap.com



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200833
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: this scope

2005-03-30 Thread Jared Rypka-Hauer - CMG, LLC
I thought it was captal C:

appliCation.CfC

Hmm, that looks wrong... aPPlication.cFc?

Ok, ok, I like Sean's spelling... Application.cfc.

Why? Because it's the one that works, that's why! Only an issue for
Solaris, OSX, Linux, etc. where case is important. Which causes me to
ask... why should a modern OS be dependent on case at all? Is there a
real reason behind it, or is it a useless legacy "feature" of a
30-year-old platform?

(ducks as the Topic Monitors start throwing off-topic grenades at my PC)

J

On Wed, 30 Mar 2005 13:56:49 -0700, Paul <[EMAIL PROTECTED]> wrote:
> Thanks for the clarification, guys.  (And I'll never spell applicAtion.cfc
> with a lowercase A again.)  :)
> 
> -Original Message-
> From: Sean Corfield [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 30, 2005 1:51 PM
> To: CF-Talk
> Subject: Re: this scope
> 
> On Wed, 30 Mar 2005 13:28:43 -0700, Paul <[EMAIL PROTECTED]> wrote:
> > I've been avoiding the "this" scope in my CFCs after reading several blogs
> > and posts on the topic.  Is that still the best practice in CFMX 7?   I
> ask
> > because all the examples I see of application.cfc set and refer to
> > this.name, this.applicationTimeout, etc.
> 
> Application.cfc (capital A!) is one of those special cases where magic
> happens behind the scenes so you have to use 'this' scope for the
> attributes that are equivalent to .
> 
> In pretty much all other cases you should avoid 'this' scope since it
> represents public instance data - and public data is a Bad Thing(tm)
> because it does not provide encapsulation.
> --
> Sean A Corfield -- http://corfield.org/
> Team Fusebox -- http://fusebox.org/
> Got Gmail? -- I have 50, yes 50, invites to give away!
> 
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood 


-- 
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com
http://www.web-relevant.com/blogs/cfobjective

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200812
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: this scope

2005-03-30 Thread Paul
Thanks for the clarification, guys.  (And I'll never spell applicAtion.cfc
with a lowercase A again.)  :)

-Original Message-
From: Sean Corfield [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 30, 2005 1:51 PM
To: CF-Talk
Subject: Re: this scope

On Wed, 30 Mar 2005 13:28:43 -0700, Paul <[EMAIL PROTECTED]> wrote:
> I've been avoiding the "this" scope in my CFCs after reading several blogs
> and posts on the topic.  Is that still the best practice in CFMX 7?   I
ask
> because all the examples I see of application.cfc set and refer to
> this.name, this.applicationTimeout, etc.

Application.cfc (capital A!) is one of those special cases where magic
happens behind the scenes so you have to use 'this' scope for the
attributes that are equivalent to .

In pretty much all other cases you should avoid 'this' scope since it
represents public instance data - and public data is a Bad Thing(tm)
because it does not provide encapsulation.
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200806
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: this scope

2005-03-30 Thread Sean Corfield
On Wed, 30 Mar 2005 13:28:43 -0700, Paul <[EMAIL PROTECTED]> wrote:
> I've been avoiding the "this" scope in my CFCs after reading several blogs
> and posts on the topic.  Is that still the best practice in CFMX 7?   I ask
> because all the examples I see of application.cfc set and refer to
> this.name, this.applicationTimeout, etc.

Application.cfc (capital A!) is one of those special cases where magic
happens behind the scenes so you have to use 'this' scope for the
attributes that are equivalent to .

In pretty much all other cases you should avoid 'this' scope since it
represents public instance data - and public data is a Bad Thing(tm)
because it does not provide encapsulation.
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200803
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: this scope

2005-03-30 Thread Dave Watts
> I've been avoiding the "this" scope in my CFCs after reading 
> several blogs and posts on the topic. Is that still the best 
> practice in CFMX 7? I ask because all the examples I see of 
> application.cfc set and refer to this.name, 
> this.applicationTimeout, etc.

Yes, avoidance of unnecessary use of public member variables is still best
practice. However, just like the usage of Application.cfm is quite a bit
different from other CF pages, the usage of Application.cfc is quite a bit
different from other CFCs. The variables that you quoted from the examples
need to be public, because those public member variables replace the
attributes of your CFAPPLICATION tag. You don't instantiate Application.cfc
the way you would normally instantiate a CFC, and you don't invoke its
methods directly, either.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200802
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: this scope

2005-03-30 Thread Adrocknaphobia
Most of what I have been reading contradicts best practices when it
comes to application.cfc. For instance, how many times on this have
you been told not to access external scopes within a CFC. It seems
like application.cfc should be the only exception to these rules.

-Adam


On Wed, 30 Mar 2005 14:36:43 -0600, Aaron Rouse <[EMAIL PROTECTED]> wrote:
> Actually those are not the only examples that refer to it from MACR.
> I was reading through some of the docs a couple weeks back in regards
> to CFCs and it was used quite a bit in there.
> 
> 
> On Wed, 30 Mar 2005 13:28:43 -0700, Paul <[EMAIL PROTECTED]> wrote:
> > I've been avoiding the "this" scope in my CFCs after reading several blogs
> > and posts on the topic.  Is that still the best practice in CFMX 7?   I ask
> > because all the examples I see of application.cfc set and refer to
> > this.name, this.applicationTimeout, etc.
> >
> >
> 
> 

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200801
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: this scope

2005-03-30 Thread Aaron Rouse
Actually those are not the only examples that refer to it from MACR. 
I was reading through some of the docs a couple weeks back in regards
to CFCs and it was used quite a bit in there.


On Wed, 30 Mar 2005 13:28:43 -0700, Paul <[EMAIL PROTECTED]> wrote:
> I've been avoiding the "this" scope in my CFCs after reading several blogs
> and posts on the topic.  Is that still the best practice in CFMX 7?   I ask
> because all the examples I see of application.cfc set and refer to
> this.name, this.applicationTimeout, etc.
> 
>

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200800
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


this scope

2005-03-30 Thread Paul
I've been avoiding the "this" scope in my CFCs after reading several blogs
and posts on the topic.  Is that still the best practice in CFMX 7?   I ask
because all the examples I see of application.cfc set and refer to
this.name, this.applicationTimeout, etc.



~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200797
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-24 Thread Adrian Lynch
A good read, a very good read.

To balance it out, get Hackers & Painters by Paul Graham also. The two
combined make for a great read, a very great read :OD

Ade

-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:25
To: CF-Talk
Subject: RE: THIS scope


LOL - there's a book I'll have to look out for and follow it religiously ;-)


-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: Friday, 25 February 2005 9:21
To: CF-Talk
Subject: RE: THIS scope

Someone's been reading The Pragmatic Programmer! Are you allowed to call
yourself pragmatic, isn't it like being cool, if you say you're cool, you're
not! :OD

Ade

-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:12
To: CF-Talk
Subject: RE: THIS scope


This is one of the reasons for my original question. I'm pragmatic - if the
Rules OF OOP Which Must Be Obeyed At All Costs don't work for me, then screw
them, especially in a language that isn't actually OO.

However, I'm always trying to pick up new good habits and best-practices.
The new version of my code is far superior to the old one; the getters and
setters let me validate the input, check if the user should even be able to
read or set the value (which was previously in the THIS scope for any
muggins to mess with) etc.

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: Friday, 25 February 2005 9:07
To: CF-Talk
Subject: RE: THIS scope

I agree with your thoughts, I'm glad you put into words what I think about
OO and CF.

An all or nothing approach seems to put many people off and no one seems to
advocate a slow move into OO with the use of good functions and site/app
architecture. Instead we get told to go down the CFC route and ask no
questions(ok, maybe not that harsh). After all, a good abstraction is a good
abstraction whether it's in a CFC or a function outside of one.

Of course there is the 'learning bad habits' excuse, but a well thought out
function is a very good thing and that excuse can be applied to everything
we do.

Ade

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:00
To: CF-Talk
Subject: Re: THIS scope

I'm an advocate of OOP but not a zealot. There are times when I see someone
create a class like this that I want to cry:


  






  


It's usually a little more involved than that, but I have seen an entire
component not much more complex than this from someone who is considered an
advanced resource... Which essentially meant that they were unhappy with
simply having a function and so they tacked on the extra overhead and
syntactical complexity of instantiating an object and carrying around two
extra scopes, etc. all so they could read a file...

Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written outside
of a CFC -- I've actually exchanged email about it with him, and I still
disagree... If a function is highly cohesive and is not _logically_ part of
a greater conceptual structure that would merit a CFC, I don't buy creating
a "miscellaneous functions" CFC just so that all your functions are in
CFC's. None of the ColdFusion native functions are grouped into CFC's, even
when there is a logical association (XML functions or Regular Expression
functions for
instance) and I have no problems using them either.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005






~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196458
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-24 Thread James Holmes
LOL - there's a book I'll have to look out for and follow it religiously ;-)


-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, 25 February 2005 9:21 
To: CF-Talk
Subject: RE: THIS scope

Someone's been reading The Pragmatic Programmer! Are you allowed to call
yourself pragmatic, isn't it like being cool, if you say you're cool, you're
not! :OD

Ade

-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:12
To: CF-Talk
Subject: RE: THIS scope


This is one of the reasons for my original question. I'm pragmatic - if the
Rules OF OOP Which Must Be Obeyed At All Costs don't work for me, then screw
them, especially in a language that isn't actually OO.

However, I'm always trying to pick up new good habits and best-practices.
The new version of my code is far superior to the old one; the getters and
setters let me validate the input, check if the user should even be able to
read or set the value (which was previously in the THIS scope for any
muggins to mess with) etc.

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: Friday, 25 February 2005 9:07
To: CF-Talk
Subject: RE: THIS scope

I agree with your thoughts, I'm glad you put into words what I think about
OO and CF.

An all or nothing approach seems to put many people off and no one seems to
advocate a slow move into OO with the use of good functions and site/app
architecture. Instead we get told to go down the CFC route and ask no
questions(ok, maybe not that harsh). After all, a good abstraction is a good
abstraction whether it's in a CFC or a function outside of one.

Of course there is the 'learning bad habits' excuse, but a well thought out
function is a very good thing and that excuse can be applied to everything
we do.

Ade

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:00
To: CF-Talk
Subject: Re: THIS scope

I'm an advocate of OOP but not a zealot. There are times when I see someone
create a class like this that I want to cry:


  






  


It's usually a little more involved than that, but I have seen an entire
component not much more complex than this from someone who is considered an
advanced resource... Which essentially meant that they were unhappy with
simply having a function and so they tacked on the extra overhead and
syntactical complexity of instantiating an object and carrying around two
extra scopes, etc. all so they could read a file...

Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written outside
of a CFC -- I've actually exchanged email about it with him, and I still
disagree... If a function is highly cohesive and is not _logically_ part of
a greater conceptual structure that would merit a CFC, I don't buy creating
a "miscellaneous functions" CFC just so that all your functions are in
CFC's. None of the ColdFusion native functions are grouped into CFC's, even
when there is a logical association (XML functions or Regular Expression
functions for
instance) and I have no problems using them either.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005




~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196455
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-24 Thread Adrian Lynch
Someone's been reading The Pragmatic Programmer! Are you allowed to call
yourself pragmatic, isn't it like being cool, if you say you're cool, you're
not! :OD

Ade

-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:12
To: CF-Talk
Subject: RE: THIS scope


This is one of the reasons for my original question. I'm pragmatic - if the
Rules OF OOP Which Must Be Obeyed At All Costs don't work for me, then screw
them, especially in a language that isn't actually OO.

However, I'm always trying to pick up new good habits and best-practices.
The new version of my code is far superior to the old one; the getters and
setters let me validate the input, check if the user should even be able to
read or set the value (which was previously in the THIS scope for any
muggins to mess with) etc.

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: Friday, 25 February 2005 9:07
To: CF-Talk
Subject: RE: THIS scope

I agree with your thoughts, I'm glad you put into words what I think about
OO and CF.

An all or nothing approach seems to put many people off and no one seems to
advocate a slow move into OO with the use of good functions and site/app
architecture. Instead we get told to go down the CFC route and ask no
questions(ok, maybe not that harsh). After all, a good abstraction is a good
abstraction whether it's in a CFC or a function outside of one.

Of course there is the 'learning bad habits' excuse, but a well thought out
function is a very good thing and that excuse can be applied to everything
we do.

Ade

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:00
To: CF-Talk
Subject: Re: THIS scope

I'm an advocate of OOP but not a zealot. There are times when I see someone
create a class like this that I want to cry:


  






  


It's usually a little more involved than that, but I have seen an entire
component not much more complex than this from someone who is considered an
advanced resource... Which essentially meant that they were unhappy with
simply having a function and so they tacked on the extra overhead and
syntactical complexity of instantiating an object and carrying around two
extra scopes, etc. all so they could read a file...

Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written outside
of a CFC -- I've actually exchanged email about it with him, and I still
disagree... If a function is highly cohesive and is not _logically_ part of
a greater conceptual structure that would merit a CFC, I don't buy creating
a "miscellaneous functions" CFC just so that all your functions are in
CFC's. None of the ColdFusion native functions are grouped into CFC's, even
when there is a logical association (XML functions or Regular Expression
functions for
instance) and I have no problems using them either.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196452
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-24 Thread James Holmes
This is one of the reasons for my original question. I'm pragmatic - if the
Rules OF OOP Which Must Be Obeyed At All Costs don't work for me, then screw
them, especially in a language that isn't actually OO.

However, I'm always trying to pick up new good habits and best-practices.
The new version of my code is far superior to the old one; the getters and
setters let me validate the input, check if the user should even be able to
read or set the value (which was previously in the THIS scope for any
muggins to mess with) etc.

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, 25 February 2005 9:07 
To: CF-Talk
Subject: RE: THIS scope

I agree with your thoughts, I'm glad you put into words what I think about
OO and CF.

An all or nothing approach seems to put many people off and no one seems to
advocate a slow move into OO with the use of good functions and site/app
architecture. Instead we get told to go down the CFC route and ask no
questions(ok, maybe not that harsh). After all, a good abstraction is a good
abstraction whether it's in a CFC or a function outside of one.

Of course there is the 'learning bad habits' excuse, but a well thought out
function is a very good thing and that excuse can be applied to everything
we do.

Ade

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:00
To: CF-Talk
Subject: Re: THIS scope

I'm an advocate of OOP but not a zealot. There are times when I see someone
create a class like this that I want to cry:


  






  


It's usually a little more involved than that, but I have seen an entire
component not much more complex than this from someone who is considered an
advanced resource... Which essentially meant that they were unhappy with
simply having a function and so they tacked on the extra overhead and
syntactical complexity of instantiating an object and carrying around two
extra scopes, etc. all so they could read a file...

Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written outside
of a CFC -- I've actually exchanged email about it with him, and I still
disagree... If a function is highly cohesive and is not _logically_ part of
a greater conceptual structure that would merit a CFC, I don't buy creating
a "miscellaneous functions" CFC just so that all your functions are in
CFC's. None of the ColdFusion native functions are grouped into CFC's, even
when there is a logical association (XML functions or Regular Expression
functions for
instance) and I have no problems using them either.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005




~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196450
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-24 Thread Adrian Lynch
I agree with your thoughts, I'm glad you put into words what I think about
OO and CF.

An all or nothing approach seems to put many people off and no one seems to
advocate a slow move into OO with the use of good functions and site/app
architecture. Instead we get told to go down the CFC route and ask no
questions(ok, maybe not that harsh). After all, a good abstraction is a good
abstraction whether it's in a CFC or a function outside of one.

Of course there is the 'learning bad habits' excuse, but a well thought out
function is a very good thing and that excuse can be applied to everything
we do.

Ade

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 01:00
To: CF-Talk
Subject: Re: THIS scope

I'm an advocate of OOP but not a zealot. There are times when I see
someone create a class like this that I want to cry:


  






  


It's usually a little more involved than that, but I have seen an
entire component not much more complex than this from someone who is
considered an advanced resource... Which essentially meant that they
were unhappy with simply having a function and so they tacked on the
extra overhead and syntactical complexity of instantiating an object
and carrying around two extra scopes, etc. all so they could read a
file...

Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written
outside of a CFC -- I've actually exchanged email about it with him,
and I still disagree... If a function is highly cohesive and is not
_logically_ part of a greater conceptual structure that would merit a
CFC, I don't buy creating a "miscellaneous functions" CFC just so that
all your functions are in CFC's. None of the ColdFusion native
functions are grouped into CFC's, even when there is a logical
association (XML functions or Regular Expression functions for
instance) and I have no problems using them either.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196449
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-24 Thread S . Isaac Dealey
> Well, yeah.  That's a way to do it.

> Is anyone else conflicted as to how many workaround we
> should make to
> enable OOP in CF when we're already able to develop some
> pretty nice
> applications?

> -Joe

I'm an advocate of OOP but not a zealot. There are times when I see
someone create a class like this that I want to cry:


  






  


It's usually a little more involved than that, but I have seen an
entire component not much more complex than this from someone who is
considered an advanced resource... Which essentially meant that they
were unhappy with simply having a function and so they tacked on the
extra overhead and syntactical complexity of instantiating an object
and carrying around two extra scopes, etc. all so they could read a
file...

Obviously I don't jive with the "it's an object or it's crap" camp...
I've heard Simon Horwith say that a function should never be written
outside of a CFC -- I've actually exchanged email about it with him,
and I still disagree... If a function is highly cohesive and is not
_logically_ part of a greater conceptual structure that would merit a
CFC, I don't buy creating a "miscellaneous functions" CFC just so that
all your functions are in CFC's. None of the ColdFusion native
functions are grouped into CFC's, even when there is a logical
association (XML functions or Regular Expression functions for
instance) and I have no problems using them either.

s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196446
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-24 Thread Dave Watts
> In retrospect I believe the cfinvoke tag will allow you to 
> execute a method of a CFC without invoking the CFC ...

It's worth pointing out that this will in fact create an instance of the CFC
itself. However, because you're not storing a reference to that instance
anywhere, you won't have any way to access it.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196410
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54



Re: THIS scope

2005-02-24 Thread Isaac Dealey
>> That doesn't really cover "static," though - what makes a
>> static
>> member static is that it belongs to the type instead of
>> one instance
>> of a type.  I.e.:
>>
>> InstanceOne.StaticVar = 1
>> InstanceTwo.StaticVar = 2
>>
>> 
>> #InstanceOne.StaticVar#
>
>Application.cfc
>- onapplicationstart
>  CreateObject("component",mystaticclass)>
>
>then reference the information as
>
>server.myStaticClass.getStaticVar();
>
>there ya go. It's not _technically_ a static class, but it's as close
>as CF offers.

In retrospect I believe the cfinvoke tag will allow you to execute a method of 
a CFC without invoking the CFC, so I take back what I said before about the 
server scope CFC being the closest thing to static... Retain the method, and 
use this to return the "public static final" variable: 



Yea, it's longer syntax... The price paid for being fastidious I guess... :) 

OR 


  
  
  
  
  
  




s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
>http://www.fusiontap.com

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196327
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-24 Thread S . Isaac Dealey
I still fail to understand why it's considered messy / nasty.

> If you let the 'final' part of 'public static final' weigh
> in
> slightly, then Isaac's proposal kind of gives you static.
> Because
> it's a method not a variable, there is only one instance
> (so it's a
> class "thing"), you can't change it like a non-final
> variable.  It's
> messy and nasty, which is why I prefer to just use a
> variable in the
> 'this' scope.

> cheers,
> barneyb

> On Wed, 23 Feb 2005 17:04:35 -0500, Joe Rinehart
> <[EMAIL PROTECTED]> wrote:
>> That doesn't really cover "static," though - what makes a
>> static
>> member static is that it belongs to the type instead of
>> one instance
>> of a type.  I.e.:
>>
>> InstanceOne.StaticVar = 1
>> InstanceTwo.StaticVar = 2
>>
>> 
>> #InstanceOne.StaticVar#


s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196294
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-24 Thread S . Isaac Dealey
> Mostly because if you're looking for a field,
> you're not going to look in the methods section
> of the class docs, even if the "field" is
> actually a method, as you proposed.  Just a
> differentiation between
> state and behaviour that you'd sacrifice.

If I knew the data was in that class (or should be) I would definately
check the methods if I didn't see it listed in the fields... For that
matter, I always check the methods for what I need first before
looking for fields as I consider this a best practice since a method
provides encapsulation that a field doesn't, and when a method is
created initially there's no need to modify code referencing the
method if it's later determined that there are conditions in which a
different value should be returned. So no I wouldn't lose anything.


s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196293
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Barney Boisvert
If you let the 'final' part of 'public static final' weigh in
slightly, then Isaac's proposal kind of gives you static.  Because
it's a method not a variable, there is only one instance (so it's a
class "thing"), you can't change it like a non-final variable.  It's
messy and nasty, which is why I prefer to just use a variable in the
'this' scope.

cheers,
barneyb

On Wed, 23 Feb 2005 17:04:35 -0500, Joe Rinehart <[EMAIL PROTECTED]> wrote:
> That doesn't really cover "static," though - what makes a static
> member static is that it belongs to the type instead of one instance
> of a type.  I.e.:
> 
> InstanceOne.StaticVar = 1
> InstanceTwo.StaticVar = 2
> 
> 
> #InstanceOne.StaticVar#
> 


-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196275
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Barney Boisvert
Mostly because if you're looking for a field, you're not going to look
in the methods section of the class docs, even if the "field" is
actually a method, as you proposed.  Just a differentiation between
state and behaviour that you'd sacrifice.

cheers,
barneyb

On Wed, 23 Feb 2005 18:37:09 -0500, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:
> I'm not sure why having it listed as a function in the documentation
> would be terribly bad... especially if it is a function and not a
> variable... I'd use a hint attribute to indicate the purpose of the
> function. I could see some developers thinking it was an odd practice,
> but I'd be hard pressed to imagine the developer for whom it was a
> challenge to decypher.


-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196273
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-23 Thread James Holmes
Thanks all for the very interesting info.

BTW, who doesn't have 50 Gmail invites and no friends ;-)

-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 24 February 2005 8:24 
To: CF-Talk
Subject: Re: THIS scope

Amen to that, brother Joe!

On Wed, 23 Feb 2005 19:17:23 -0500, Joe Rinehart <[EMAIL PROTECTED]>
wrote:
> Well, yeah.  That's a way to do it.
> 
> Is anyone else conflicted as to how many workaround we should make to 
> enable OOP in CF when we're already able to develop some pretty nice 
> applications?
> 
> -Joe


--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196263
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Barney Boisvert
Amen to that, brother Joe!

On Wed, 23 Feb 2005 19:17:23 -0500, Joe Rinehart <[EMAIL PROTECTED]> wrote:
> Well, yeah.  That's a way to do it.
> 
> Is anyone else conflicted as to how many workaround we should make to
> enable OOP in CF when we're already able to develop some pretty nice
> applications?
> 
> -Joe


-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196248
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Joe Rinehart
Well, yeah.  That's a way to do it.  

Is anyone else conflicted as to how many workaround we should make to
enable OOP in CF when we're already able to develop some pretty nice
applications?

-Joe


On Wed, 23 Feb 2005 18:37:07 -0500, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:
> Application.cfc
> - onapplicationstart
>CreateObject("component",mystaticclass)>
> 
> then reference the information as
> 
> server.myStaticClass.getStaticVar();
> 
> there ya go. It's not _technically_ a static class, but it's as close
> as CF offers.
> 
> > That doesn't really cover "static," though - what makes a
> > static
> > member static is that it belongs to the type instead of
> > one instance
> > of a type.  I.e.:
> 
> > InstanceOne.StaticVar = 1
> > InstanceTwo.StaticVar = 2
> 
> > 
> > #InstanceOne.StaticVar#
> 
> > On Wed, 23 Feb 2005 16:52:52 -0500, S. Isaac Dealey
> > <[EMAIL PROTECTED]> wrote:
> >> > I use the 'this' scope for what would be public static
> >> > final variable
> >> > in Java.  That is, values that are of use both inside
> >> > and
> >> > outside a
> >> > class, but never change.  CF doesn't give you the
> >> > ability
> >> > to actually
> >> > make them read-only (or make them class fields, rather
> >> > than instance
> >> > fields), but that's an lack of functionalitythat I live
> >> > with.
> >>
> >> yes and no...
> >>
> >> 
> >> 
> >> 
> >> 
> >> 
> >>
> >> It's not technically a variable, rather it's a method
> >> which returns a
> >> hard-coded value -- but because it's not actually stored
> >> in a
> >> variable, it becomes essentially a constant. You can call
> >> static.getMyVar() to return the value but unless you
> >> extend the
> >> component you'll never be able to change what getMyVar()
> >> returns.
> >> Which covers public and static... I'll grant that it
> >> doesn't allow you
> >> the "final" part of what would be available with Java.
> >>
> >> s. isaac dealey   954.927.5117
> >> new epoch : isn't it time for a change?
> >>
> >> add features without fixtures with
> >> the onTap open source framework
> >> http://www.fusiontap.com
> 
> 
> s. isaac dealey 954.927.5117
> new epoch : isn't it time for a change?
> 
> add features without fixtures with
> the onTap open source framework
> 
> http://macromedia.breezecentral.com/p49777853/
> http://www.sys-con.com/story/?storyid=44477&DE=1
> http://www.sys-con.com/story/?storyid=45569&DE=1
> http://www.fusiontap.com
> 
> 

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196246
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread S . Isaac Dealey
I'm not sure why having it listed as a function in the documentation
would be terribly bad... especially if it is a function and not a
variable... I'd use a hint attribute to indicate the purpose of the
function. I could see some developers thinking it was an odd practice,
but I'd be hard pressed to imagine the developer for whom it was a
challenge to decypher.

> Yeah, but then you've got a method, not a field.  Those
> extra parens
> aren't a huge deal to type every time, but having the
> psuedo-field
> listed with the other methods rather than as a field in
> generated
> documentation is a pain, as is the inability to use
> CFPROPERTY to
> document the field.

> cheers,
> barneyb

> On Wed, 23 Feb 2005 16:52:52 -0500, S. Isaac Dealey
> <[EMAIL PROTECTED]> wrote:
>> > I use the 'this' scope for what would be public static
>> > final variable
>> > in Java.  That is, values that are of use both inside
>> > and
>> > outside a
>> > class, but never change.  CF doesn't give you the
>> > ability
>> > to actually
>> > make them read-only (or make them class fields, rather
>> > than instance
>> > fields), but that's an lack of functionalitythat I live
>> > with.
>>
>> yes and no...
>>
>> 
>> 
>> 
>> 
>> 
>>
>> It's not technically a variable, rather it's a method
>> which returns a
>> hard-coded value -- but because it's not actually stored
>> in a
>> variable, it becomes essentially a constant. You can call
>> static.getMyVar() to return the value but unless you
>> extend the
>> component you'll never be able to change what getMyVar()
>> returns.
>> Which covers public and static... I'll grant that it
>> doesn't allow you
>> the "final" part of what would be available with Java.
>>
>> s. isaac dealey   954.927.5117
>> new epoch : isn't it time for a change?
>>



s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196232
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread S . Isaac Dealey
Application.cfc
- onapplicationstart
  

then reference the information as

server.myStaticClass.getStaticVar();

there ya go. It's not _technically_ a static class, but it's as close
as CF offers.

> That doesn't really cover "static," though - what makes a
> static
> member static is that it belongs to the type instead of
> one instance
> of a type.  I.e.:

> InstanceOne.StaticVar = 1
> InstanceTwo.StaticVar = 2

> 
> #InstanceOne.StaticVar#

> On Wed, 23 Feb 2005 16:52:52 -0500, S. Isaac Dealey
> <[EMAIL PROTECTED]> wrote:
>> > I use the 'this' scope for what would be public static
>> > final variable
>> > in Java.  That is, values that are of use both inside
>> > and
>> > outside a
>> > class, but never change.  CF doesn't give you the
>> > ability
>> > to actually
>> > make them read-only (or make them class fields, rather
>> > than instance
>> > fields), but that's an lack of functionalitythat I live
>> > with.
>>
>> yes and no...
>>
>> 
>> 
>> 
>> 
>> 
>>
>> It's not technically a variable, rather it's a method
>> which returns a
>> hard-coded value -- but because it's not actually stored
>> in a
>> variable, it becomes essentially a constant. You can call
>> static.getMyVar() to return the value but unless you
>> extend the
>> component you'll never be able to change what getMyVar()
>> returns.
>> Which covers public and static... I'll grant that it
>> doesn't allow you
>> the "final" part of what would be available with Java.
>>
>> s. isaac dealey   954.927.5117
>> new epoch : isn't it time for a change?
>>
>> add features without fixtures with
>> the onTap open source framework
>> http://www.fusiontap.com


s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196232
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Barney Boisvert
Yeah, but then you've got a method, not a field.  Those extra parens
aren't a huge deal to type every time, but having the psuedo-field
listed with the other methods rather than as a field in generated
documentation is a pain, as is the inability to use CFPROPERTY to
document the field.

cheers,
barneyb

On Wed, 23 Feb 2005 16:52:52 -0500, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:
> > I use the 'this' scope for what would be public static
> > final variable
> > in Java.  That is, values that are of use both inside and
> > outside a
> > class, but never change.  CF doesn't give you the ability
> > to actually
> > make them read-only (or make them class fields, rather
> > than instance
> > fields), but that's an lack of functionalitythat I live
> > with.
> 
> yes and no...
> 
> 
> 
> 
> 
> 
> 
> It's not technically a variable, rather it's a method which returns a
> hard-coded value -- but because it's not actually stored in a
> variable, it becomes essentially a constant. You can call
> static.getMyVar() to return the value but unless you extend the
> component you'll never be able to change what getMyVar() returns.
> Which covers public and static... I'll grant that it doesn't allow you
> the "final" part of what would be available with Java.
> 
> s. isaac dealey   954.927.5117
> new epoch : isn't it time for a change?
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196202
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Joe Rinehart
That doesn't really cover "static," though - what makes a static
member static is that it belongs to the type instead of one instance
of a type.  I.e.:

InstanceOne.StaticVar = 1
InstanceTwo.StaticVar = 2


#InstanceOne.StaticVar# 

On Wed, 23 Feb 2005 16:52:52 -0500, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:
> > I use the 'this' scope for what would be public static
> > final variable
> > in Java.  That is, values that are of use both inside and
> > outside a
> > class, but never change.  CF doesn't give you the ability
> > to actually
> > make them read-only (or make them class fields, rather
> > than instance
> > fields), but that's an lack of functionalitythat I live
> > with.
> 
> yes and no...
> 
> 
> 
> 
> 
> 
> 
> It's not technically a variable, rather it's a method which returns a
> hard-coded value -- but because it's not actually stored in a
> variable, it becomes essentially a constant. You can call
> static.getMyVar() to return the value but unless you extend the
> component you'll never be able to change what getMyVar() returns.
> Which covers public and static... I'll grant that it doesn't allow you
> the "final" part of what would be available with Java.
> 
> s. isaac dealey   954.927.5117
> new epoch : isn't it time for a change?
> 
> add features without fixtures with
> the onTap open source framework
> http://www.fusiontap.com
> 
> 
> 

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196200
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread S . Isaac Dealey
> I use the 'this' scope for what would be public static
> final variable
> in Java.  That is, values that are of use both inside and
> outside a
> class, but never change.  CF doesn't give you the ability
> to actually
> make them read-only (or make them class fields, rather
> than instance
> fields), but that's an lack of functionalitythat I live
> with.

yes and no...







It's not technically a variable, rather it's a method which returns a
hard-coded value -- but because it's not actually stored in a
variable, it becomes essentially a constant. You can call
static.getMyVar() to return the value but unless you extend the
component you'll never be able to change what getMyVar() returns.
Which covers public and static... I'll grant that it doesn't allow you
the "final" part of what would be available with Java.

s. isaac dealey   954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.fusiontap.com




~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196192
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Barney Boisvert
I use the 'this' scope for what would be public static final variable
in Java.  That is, values that are of use both inside and outside a
class, but never change.  CF doesn't give you the ability to actually
make them read-only (or make them class fields, rather than instance
fields), but that's an lack of functionalitythat I live with.

The one other place where I'd say it's "ok" to use the 'this' scope is
if you intentionally have a unencapsulated object.  I.e. something
that is really just a collection of data, not a real object, but you
need to package it as a CFC, rather than a Struct, for some reason
(like an init() method).

cheers,
barneyb

On Wed, 23 Feb 2005 17:03:43 +0800, James Holmes
<[EMAIL PROTECTED]> wrote:
> Does anyone use the THIS scope any more? Having just converted some nasty
> old (CF 6.0) CFCs using THIS in external code and all sorts of other bad
> things to really nice, new, VARIABLES scope code using getters and setters,
> I can't see a use for THIS, except for the return in an init() method.
> 
> Does anyone have a use for THIS that I am missing?
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196185
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Thomas Chiverton
On Wednesday 23 Feb 2005 09:03 am, James Holmes wrote:
> Does anyone use the THIS scope any more? Having just converted some nasty

I put public attributes and simple things that aren't worth writing a get and 
set for in it.

-- 
Tom Chiverton 
Advanced ColdFusion Programmer

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196114
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread S . Isaac Dealey
> Does anyone use the THIS scope any more? Having just
> converted some nasty
> old (CF 6.0) CFCs using THIS in external code and all
> sorts of other bad
> things to really nice, new, VARIABLES scope code using
> getters and setters,
> I can't see a use for THIS, except for the return in an
> init() method.

> Does anyone have a use for THIS that I am missing?

I've used it to inject methods into a CFC to create dynamic and
multiple inheritance. (An end-run around the lack of variables in the
extends attribute). Asside from that I avoid it.


s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196095
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread S . Isaac Dealey
> Does anyone use the THIS scope any more? Having just
> converted some nasty
> old (CF 6.0) CFCs using THIS in external code and all
> sorts of other bad
> things to really nice, new, VARIABLES scope code using
> getters and setters,
> I can't see a use for THIS, except for the return in an
> init() method.

> Does anyone have a use for THIS that I am missing?

I've used it to inject methods into a CFC to create dynamic and
multiple inheritance. (An end-run around the lack of variables in the
extends attribute). Asside from that I avoid it.


s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196095
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Joe Rinehart
James,

I use the "THIS" scope for creating complex types to be sent over Web
Services.  I think that's about the only time I use it anymore.

-Joe


On Wed, 23 Feb 2005 17:03:43 +0800, James Holmes
<[EMAIL PROTECTED]> wrote:
> Does anyone use the THIS scope any more? Having just converted some nasty
> old (CF 6.0) CFCs using THIS in external code and all sorts of other bad
> things to really nice, new, VARIABLES scope code using getters and setters,
> I can't see a use for THIS, except for the return in an init() method.
> 
> Does anyone have a use for THIS that I am missing?
> 
> 

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196073
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Duncan
Sorry - I should have mentioned I cut that from an earlier post from
Sean to one of my questions.

Duncan

On Wed, 23 Feb 2005 01:35:58 -0800, Sean Corfield
<[EMAIL PROTECTED]> wrote:
> Strange... that's my response to another thread here on cf-talk...???
> 
> On Wed, 23 Feb 2005 20:11:42 +1100, Duncan <[EMAIL PROTECTED]> wrote:
> > Application.cfc effectively replaces the  tag. This tag:
> >
> > 
> >
> > becomes the following code in the pseudo-constructor area of
> > Application.cfc (i.e., immediately after the opening 
> > tag):
> >
> > 
> > 
> > 
> >
> > See the following documentation:
> >
> > Reference Manual:
> >
> > http://livedocs.macromedia.com/coldfusion/7/htmldocs/0693.htm
> >
> > Developing ColdFusion Applications:
> >
> > http://livedocs.macromedia.com/coldfusion/7/htmldocs/1115.htm
> > http://livedocs.macromedia.com/coldfusion/7/htmldocs/1123.htm
> >
> > On Wed, 23 Feb 2005 17:03:43 +0800, James Holmes
> > <[EMAIL PROTECTED]> wrote:
> > > Does anyone use the THIS scope any more? Having just converted some nasty
> > > old (CF 6.0) CFCs using THIS in external code and all sorts of other bad
> > > things to really nice, new, VARIABLES scope code using getters and 
> > > setters,
> > > I can't see a use for THIS, except for the return in an init() method.
> > >
> > > Does anyone have a use for THIS that I am missing?
> > >
> > >
> >
> 
> 

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196071
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: THIS scope

2005-02-23 Thread James Holmes
I probably should have mentioned that we are on 6.1.

Even in that case in CF7, I just tested and they don't have to be THIS
variables, they can be put in the VARIABLES scope.

-Original Message-
From: Duncan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 23 February 2005 5:12 
To: CF-Talk
Subject: Re: THIS scope

Application.cfc effectively replaces the  tag. This tag:



becomes the following code in the pseudo-constructor area of Application.cfc
(i.e., immediately after the opening 
tag):


 

See the following documentation:

Reference Manual:

http://livedocs.macromedia.com/coldfusion/7/htmldocs/0693.htm

Developing ColdFusion Applications:

http://livedocs.macromedia.com/coldfusion/7/htmldocs/1115.htm
http://livedocs.macromedia.com/coldfusion/7/htmldocs/1123.htm

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196067
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Sean Corfield
Strange... that's my response to another thread here on cf-talk...???

On Wed, 23 Feb 2005 20:11:42 +1100, Duncan <[EMAIL PROTECTED]> wrote:
> Application.cfc effectively replaces the  tag. This tag:
> 
> 
> 
> becomes the following code in the pseudo-constructor area of
> Application.cfc (i.e., immediately after the opening 
> tag):
> 
> 
> 
> 
> 
> See the following documentation:
> 
> Reference Manual:
> 
> http://livedocs.macromedia.com/coldfusion/7/htmldocs/0693.htm
> 
> Developing ColdFusion Applications:
> 
> http://livedocs.macromedia.com/coldfusion/7/htmldocs/1115.htm
> http://livedocs.macromedia.com/coldfusion/7/htmldocs/1123.htm
> 
> On Wed, 23 Feb 2005 17:03:43 +0800, James Holmes
> <[EMAIL PROTECTED]> wrote:
> > Does anyone use the THIS scope any more? Having just converted some nasty
> > old (CF 6.0) CFCs using THIS in external code and all sorts of other bad
> > things to really nice, new, VARIABLES scope code using getters and setters,
> > I can't see a use for THIS, except for the return in an init() method.
> >
> > Does anyone have a use for THIS that I am missing?
> >
> >
>

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196066
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: THIS scope

2005-02-23 Thread Duncan
Application.cfc effectively replaces the  tag. This tag:



becomes the following code in the pseudo-constructor area of
Application.cfc (i.e., immediately after the opening 
tag):





See the following documentation:

Reference Manual:

http://livedocs.macromedia.com/coldfusion/7/htmldocs/0693.htm

Developing ColdFusion Applications:

http://livedocs.macromedia.com/coldfusion/7/htmldocs/1115.htm
http://livedocs.macromedia.com/coldfusion/7/htmldocs/1123.htm


On Wed, 23 Feb 2005 17:03:43 +0800, James Holmes
<[EMAIL PROTECTED]> wrote:
> Does anyone use the THIS scope any more? Having just converted some nasty
> old (CF 6.0) CFCs using THIS in external code and all sorts of other bad
> things to really nice, new, VARIABLES scope code using getters and setters,
> I can't see a use for THIS, except for the return in an init() method.
> 
> Does anyone have a use for THIS that I am missing?
> 
> 

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196064
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


THIS scope

2005-02-23 Thread James Holmes
Does anyone use the THIS scope any more? Having just converted some nasty
old (CF 6.0) CFCs using THIS in external code and all sorts of other bad
things to really nice, new, VARIABLES scope code using getters and setters,
I can't see a use for THIS, except for the return in an init() method.

Does anyone have a use for THIS that I am missing?


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196063
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Properties in CFCs: Here is the use (Was RE: Using THIS scope in CFCs)

2002-07-18 Thread Jeffry Houser

  Here is a different question..
  Is XML a supported returntype?

At 09:42 AM 7/18/2002 -0400, you wrote:
>Let me add - though - that I encourage the use of cfproperty. Like I
>said before, it can be used for validation, and it also shows up when
>you display the CFC, which adds a helpful reminder of the data your CFC
>uses.
>
>FYI - I'd rewrite your method like so:
>
> 
>   
>   
> 
>
>Notice the use of returnType? This adds another layer of protection in
>your CFC to ensure you return the right type of data.



--
Jeffry Houser | mailto:[EMAIL PROTECTED]
Need a Web Developer?  Contact me!
AIM: Reboog711  | Phone: 1-203-379-0773
--
My CFMX Book: 

My Books: http://www.instantcoldfusion.com
My Band: http://www.farcryfly.com 

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Properties in CFCs: Here is the use (Was RE: Using THIS scope in CFCs)

2002-07-18 Thread Jeffry Houser

At 09:32 AM 7/18/2002 -0400, you wrote:
> >   Tsk, Tsk...   Ray is wrong.  ( That never happens).
>
>Actually, I'm not. (grin)
>
> > Create a CFC called name.cfc :
> >
> > 
> > 
>[deletia]
>
> >
> >   Supposedly, this is not possible without properties.  (
> > according to one
> > of my conversations during the beta cycle).  My own CF Server
>
>Incorrect. You can use CFCs as types in method arguments (or
>returnTypes) w/o using cfproperty inside them.

  I wasn't trying to say that you need properties to use a CFC as a method 
argument / returntype.
  I was saying that properties are used to match up the argument with a 
proper component instance.  Of course as near as I can tell now, that is 
wrong.  I want to bop the head of the Macromedia engineer who explained 
this to me during the beta cycle. : grumbles:


--
Jeffry Houser | mailto:[EMAIL PROTECTED]
Need a Web Developer?  Contact me!
AIM: Reboog711  | Phone: 1-203-379-0773
--
My CFMX Book: 

My Books: http://www.instantcoldfusion.com
My Band: http://www.farcryfly.com 

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Properties in CFCs: Here is the use (Was RE: Using THIS scope in CFCs)

2002-07-18 Thread Raymond Camden

Let me add - though - that I encourage the use of cfproperty. Like I
said before, it can be used for validation, and it also shows up when
you display the CFC, which adds a helpful reminder of the data your CFC
uses.

FYI - I'd rewrite your method like so:


  
  


Notice the use of returnType? This adds another layer of protection in
your CFC to ensure you return the right type of data.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Raymond Camden [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, July 18, 2002 9:33 AM
> To: CF-Talk
> Subject: RE: Properties in CFCs: Here is the use (Was RE: 
> Using THIS scope in CFCs)
> 
> 
> >   Tsk, Tsk...   Ray is wrong.  ( That never happens).
> 
> Actually, I'm not. (grin)
> 
> > Create a CFC called name.cfc :
> > 
> > 
> > 
> [deletia]
> 
> > 
> >   Supposedly, this is not possible without properties.  (
> > according to one 
> > of my conversations during the beta cycle).  My own CF Server 
> 
> Incorrect. You can use CFCs as types in method arguments (or
> returnTypes) w/o using cfproperty inside them.
> 
> ==
> =
> Raymond Camden, ColdFusion Jedi Master for Macromedia
> 
> Email: [EMAIL PROTECTED]
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda 
> 
> 
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-18 Thread Raymond Camden

It doesn't really matter if you use "ray" in your CFML, I littered it
all over the source code. ;)

(just joking... really)

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Todd [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, July 17, 2002 7:48 PM
> To: CF-Talk
> Subject: Re: Using THIS scope in CFCs
> 
> 
> Ray, you seem to encourage a lot of usage of the word 'ray' in our 
> applications... I thought I saw a best practice somewhere 
> that said having 
> 'ray' in our apps is a "bad thing" ...? :D

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Properties in CFCs: Here is the use (Was RE: Using THIS scope in CFCs)

2002-07-18 Thread Raymond Camden

>   Tsk, Tsk...   Ray is wrong.  ( That never happens).

Actually, I'm not. (grin)

> Create a CFC called name.cfc :
> 
> 
> 
[deletia]

> 
>   Supposedly, this is not possible without properties.  ( 
> according to one 
> of my conversations during the beta cycle).  My own CF Server 

Incorrect. You can use CFCs as types in method arguments (or
returnTypes) w/o using cfproperty inside them.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 


__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Properties in CFCs: Here is the use (Was RE: Using THIS scope in CFCs)

2002-07-17 Thread Jeffry Houser

  Tsk, Tsk...   Ray is wrong.  ( That never happens).
  In his defense, so is the documentation that states that properties do 
nothing for CFCs except provide metadata documentation.

This is an example of how you can use them (Something similar to this is in 
the Web services docs, but the same principle applies to CFCs).

Create a CFC called name.cfc :






Now create a CFC called usename.cfc:


  
  



Notice the type of the argument is name, which refers to the other CFC.

Now, in a normal template you can do the invoking like this:









  Supposedly, this is not possible without properties.  ( according to one 
of my conversations during the beta cycle).  My own CF Server seems to have 
gone down for no reason while experimenting with this, but..  it did seem 
to be true last time I played around with it.


At 05:08 PM 7/17/2002 -0400, you wrote:
> > Now explain .  In the example below, for example,
> > what would be different if you made ID a property of the
> > human object rather than a non-var local variable?
>
>
>When using CFCs,  does absolutely nothing. It can be used to
>help describe web services, but strictly speaking for CFCs, they don't
>do anything... except...
>
>You can use  to define metadata for the CFC. For example, I
>may do this in my CFC:
>
>
>
>
>Now if I call getMetaData on the CFC, I will see age as a property.
>
>What's cool is that I can write a validation routine that says:
>
>Since Age is defined as Numeric, look at this.age. Is it numeric? If
>not, throw an error.
>
>I have a general purpose UDF that allows you to use  in your
>CFC and then perform validation on the object data. (It even recurses up
>the inheritance.)
>
>Does that help? By the way, you can even do stuff like:
>
>
>
>Both range and ray will show up in the metadata and you can use them as
>you see fit.
>
> > In that case would ID be something that *is*
> > viewable/changeable by the user (which would be a bad idea
>
>No. CFPROPERTY will not change how the value ID is visible. It shows up
>in the metadata as a property, but the VALUE doesn't.
>
>===
>Raymond Camden, ColdFusion Jedi Master for Macromedia
>
>Email: [EMAIL PROTECTED]
>Yahoo IM : morpheus
>
>"My ally is the Force, and a powerful ally it is." - Yoda
>
>
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Jeffry Houser

  :smile:  I know that Simon and I have some differing thoughts on 
components, so for the sake of the record I will state mine here.

  Components are the mother of code re-use constructs.  I don't like 
calling them objects, because they are not featured enough to allow for the 
implementation of a true object oriented design, but portions of them are 
based off the OO methodology.  I think of them as Abstract Data Types, with 
an OO touch.

At 04:41 PM 7/17/2002 -0400, you wrote:
>the only comment I have is that if you are using components to build object
>modeled applications, you shouldn't be including files from cfcs.  My
>opinion is that components are not just another code re-use
>constructthey're an entirely different beast.  If you are using them,
>you should know "object think".
>
>~Simon
>
>Simon Horwith
>Macromedia Certified Instructor
>Certified Advanced ColdFusion 5 Developer
>Fig Leaf Software
>1400 16th St NW, # 500
>Washington DC 20036
>202.797.6570 (direct line)
>www.figleaf.com
>
>
>
>-Original Message-
>From: Stacy Young [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, July 17, 2002 4:25 PM
>To: CF-Talk
>Subject: Using THIS scope in CFCs
>
>
>I'm using THIS scope in my included files used within my CFCs since the
>argument scope is not available. (I believe is known issue). The downside to
>this is I have to append the argument scope.
>
>I was previously using ATTRIBUTES scope but I figure THIS is safer...
>
>
>
>Comments/suggestions?
>
>
>
>
>
>AVIS IMPORTANT:
>---
>Les informations contenues dans le present document et ses pieces jointes
>sont strictement confidentielles et reservees a l'usage de la (des)
>personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez
>avise que toute divulgation, distribution, copie, ou autre utilisation de
>ces informations est strictement prohibee.  Si vous avez recu ce document
>par erreur, veuillez s'il vous plait communiquer immediatement avec
>l'expediteur et detruire ce document sans en faire de copie sous quelque
>forme.
>
>WARNING:
>---
>The information contained in this document and attachments is confidential
>and intended only for the person(s) named above.  If you are not the
>intended recipient you are hereby notified that any disclosure, copying,
>distribution, or any other use of the information is strictly prohibited.
>If you have received this document by mistake, please notify the sender
>immediately and destroy this document and attachments without making any
>copy of any kind.
>
>
>
>
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Using THIS scope in CFCs

2002-07-17 Thread Todd

Ray, you seem to encourage a lot of usage of the word 'ray' in our 
applications... I thought I saw a best practice somewhere that said having 
'ray' in our apps is a "bad thing" ...? :D

~Todd

At 06:16 PM 7/17/2002 -0400, you wrote:
>  Cool stuff and good to know.  My inner toddler has
>found her pacifier. Thanks, Ray.
>
>-Patti
>
>On 7/17/02 5:08 PM, "Raymond Camden" <[EMAIL PROTECTED]> wrote:
>
> >> Now explain .  In the example below, for example,
> >> what would be different if you made ID a property of the
> >> human object rather than a non-var local variable?
> >
> >
> > When using CFCs,  does absolutely nothing. It can be used to
> > help describe web services, but strictly speaking for CFCs, they don't
> > do anything... except...
> >
> > You can use  to define metadata for the CFC. For example, I
> > may do this in my CFC:
> >
> > 
> > 
> >
> > Now if I call getMetaData on the CFC, I will see age as a property.
> >
> > What's cool is that I can write a validation routine that says:
> >
> > Since Age is defined as Numeric, look at this.age. Is it numeric? If
> > not, throw an error.
> >
> > I have a general purpose UDF that allows you to use  in your
> > CFC and then perform validation on the object data. (It even recurses up
> > the inheritance.)
> >
> > Does that help? By the way, you can even do stuff like:
> >
> > 
> >
> > Both range and ray will show up in the metadata and you can use them as
> > you see fit.
> >
> >> In that case would ID be something that *is*
> >> viewable/changeable by the user (which would be a bad idea
> >
> > No. CFPROPERTY will not change how the value ID is visible. It shows up
> > in the metadata as a property, but the VALUE doesn't.
> >
> > ===
> > Raymond Camden, ColdFusion Jedi Master for Macromedia
> >
> > Email: [EMAIL PROTECTED]
> > Yahoo IM : morpheus
> >
> > "My ally is the Force, and a powerful ally it is." - Yoda
> >
> >
>
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Hal Helms

I agree, Ben. That's very frustrating. Also, the inability to call a
component's parent using super() or something like it is a tremendous
hit to anything like OO programming.

-Original Message-
From: Benjamin S. Rogers [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 17, 2002 5:59 PM
To: CF-Talk
Subject: RE: Using THIS scope in CFCs


> the only comment I have is that if you are using components to
> build object modeled applications, you shouldn't be including 
> files from cfcs.

I don't know what the original poster is using includes for, but I think
there are some really valid reasons to include files into a CFC.
Unfortunately, there are some really monumental problems with CFCs that
make including files problematic (i.e. the argument scope isn't
available or the fact that CFReturn is silently ignored in an included
file).

The reason I originally started experimenting with including files into
CFCs is that, if I included all of the actual logic of a function, it
kept both the CFC file and function files short and sweet. Additionally,
since ColdFusion supports dynamic includes, I reasoned that if I was
working on one function and had a syntax error in my code, it would not
cause other functions of the same CFC to throw an error.

Now, that said, I don't think CFIncludes are a great choice for code
reuse, at least not in an environment that supports custom tags,
CFModule calls, CFCs, etc. Nevertheless, I think there are several valid
reasons for using the CFInclude tag within CFCs. However, current CFC
bugs make it necessary to implement inelegant workarounds.

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


__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Using THIS scope in CFCs

2002-07-17 Thread Patti G. L. Hall

  Cool stuff and good to know.  My inner toddler has
found her pacifier. Thanks, Ray.

-Patti

On 7/17/02 5:08 PM, "Raymond Camden" <[EMAIL PROTECTED]> wrote:

>> Now explain .  In the example below, for example,
>> what would be different if you made ID a property of the
>> human object rather than a non-var local variable?
> 
> 
> When using CFCs,  does absolutely nothing. It can be used to
> help describe web services, but strictly speaking for CFCs, they don't
> do anything... except...
> 
> You can use  to define metadata for the CFC. For example, I
> may do this in my CFC:
> 
> 
> 
> 
> Now if I call getMetaData on the CFC, I will see age as a property.
> 
> What's cool is that I can write a validation routine that says:
> 
> Since Age is defined as Numeric, look at this.age. Is it numeric? If
> not, throw an error.
> 
> I have a general purpose UDF that allows you to use  in your
> CFC and then perform validation on the object data. (It even recurses up
> the inheritance.)
> 
> Does that help? By the way, you can even do stuff like:
> 
> 
> 
> Both range and ray will show up in the metadata and you can use them as
> you see fit.
> 
>> In that case would ID be something that *is*
>> viewable/changeable by the user (which would be a bad idea
> 
> No. CFPROPERTY will not change how the value ID is visible. It shows up
> in the metadata as a property, but the VALUE doesn't.
> 
> ===
> Raymond Camden, ColdFusion Jedi Master for Macromedia
> 
> Email: [EMAIL PROTECTED]
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda
> 
> 
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Raymond Camden

> Now explain .  In the example below, for example, 
> what would be different if you made ID a property of the 
> human object rather than a non-var local variable?


When using CFCs,  does absolutely nothing. It can be used to
help describe web services, but strictly speaking for CFCs, they don't
do anything... except... 

You can use  to define metadata for the CFC. For example, I
may do this in my CFC:




Now if I call getMetaData on the CFC, I will see age as a property.

What's cool is that I can write a validation routine that says:

Since Age is defined as Numeric, look at this.age. Is it numeric? If
not, throw an error.

I have a general purpose UDF that allows you to use  in your
CFC and then perform validation on the object data. (It even recurses up
the inheritance.)

Does that help? By the way, you can even do stuff like:



Both range and ray will show up in the metadata and you can use them as
you see fit.

> In that case would ID be something that *is* 
> viewable/changeable by the user (which would be a bad idea 

No. CFPROPERTY will not change how the value ID is visible. It shows up
in the metadata as a property, but the VALUE doesn't.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Benjamin S. Rogers

> the only comment I have is that if you are using components to 
> build object modeled applications, you shouldn't be including 
> files from cfcs.

I don't know what the original poster is using includes for, but I think
there are some really valid reasons to include files into a CFC.
Unfortunately, there are some really monumental problems with CFCs that
make including files problematic (i.e. the argument scope isn't
available or the fact that CFReturn is silently ignored in an included
file).

The reason I originally started experimenting with including files into
CFCs is that, if I included all of the actual logic of a function, it
kept both the CFC file and function files short and sweet. Additionally,
since ColdFusion supports dynamic includes, I reasoned that if I was
working on one function and had a syntax error in my code, it would not
cause other functions of the same CFC to throw an error.

Now, that said, I don't think CFIncludes are a great choice for code
reuse, at least not in an environment that supports custom tags,
CFModule calls, CFCs, etc. Nevertheless, I think there are several valid
reasons for using the CFInclude tag within CFCs. However, current CFC
bugs make it necessary to implement inelegant workarounds.

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

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Using THIS scope in CFCs

2002-07-17 Thread Patti G. L. Hall

All right.  I can see the difference from your example.  Now, just to be
like the proverbial toddler that doesn't know when to stop asking "why"...

Now explain .  In the example below, for example, what would be
different if you made ID a property of the human object rather than a
non-var local variable?

In that case would ID be something that *is* viewable/changeable by the user
(which would be a bad idea for an ID, of course).  If I wanted info that the
user could see or change, why would I decide to do this.name rather than
?

I'd love to promise that I'll stop after this one.

-Patti

On 7/17/02 4:49 PM, "Raymond Camden" <[EMAIL PROTECTED]> wrote:

>> Wait... I just got confused.  Why is it more private if you
>> don't var the variable?  I get the "This" aspect just fine.
>> But if by not var-ing, you run the risk of variable
>> overwriting when calling cfcs from other cfcs, then why is it
>> "more local" or "private" not to var?
>> 
> 
> 
> Sorry, let me back up a bit.
> 
> Imagine a CFC that looks like so:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> What I have here is the bare skeleton of a "human" CFC. I also define to
> variables, name and age, in the this scope. These values are public. If
> I make an instance of "human" called Ray, I can output ray.name.
> 
> So - it's not that much of a stretch to imagine needing data that is NOT
> public. For example, maybe ID:
> 
> 
> 
> 
> 
> The ID value will persist along with name and age, but will not be
> viewable/changeble by the user.
> 
> So - how would you use this data in methods? You would treat it as any
> other global variable. That means if you have methods that also use the
> variable ID, but you mean it to be a temp var, you would need to var
> scope them.
> 
> The basic idea is - if you use data that is NOT "This" scoped or "var"
> scoped, you can consider it as a private variable. As long as you are
> anal about var scoping everything else, these values will be safe.
> 
> Make sense?
> 
> Before certain people jump on me - I am NOT saying this is 100% like the
> private scope in Java. I'm just saying it acts like a set of data that
> is private to the CFC. Enjoy. Use it or not - it's up to you.
> 
> ===
> Raymond Camden, ColdFusion Jedi Master for Macromedia
> 
> Email: [EMAIL PROTECTED]
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda
> 
> 
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Raymond Camden

> Wait... I just got confused.  Why is it more private if you 
> don't var the variable?  I get the "This" aspect just fine.  
> But if by not var-ing, you run the risk of variable 
> overwriting when calling cfcs from other cfcs, then why is it 
> "more local" or "private" not to var?
> 


Sorry, let me back up a bit.

Imagine a CFC that looks like so:










What I have here is the bare skeleton of a "human" CFC. I also define to
variables, name and age, in the this scope. These values are public. If
I make an instance of "human" called Ray, I can output ray.name.

So - it's not that much of a stretch to imagine needing data that is NOT
public. For example, maybe ID:





The ID value will persist along with name and age, but will not be
viewable/changeble by the user.

So - how would you use this data in methods? You would treat it as any
other global variable. That means if you have methods that also use the
variable ID, but you mean it to be a temp var, you would need to var
scope them.

The basic idea is - if you use data that is NOT "This" scoped or "var"
scoped, you can consider it as a private variable. As long as you are
anal about var scoping everything else, these values will be safe.

Make sense?

Before certain people jump on me - I am NOT saying this is 100% like the
private scope in Java. I'm just saying it acts like a set of data that
is private to the CFC. Enjoy. Use it or not - it's up to you.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Using THIS scope in CFCs

2002-07-17 Thread S . Isaac Dealey

>> That being said - you can use a 'pseudo' private scope in CFCs by not
>> using var or This. In ways, it acts like a local Variables scope for
>
> Wait... I just got confused.  Why is it more private if you don't var the
> variable?  I get the "This" aspect just fine.  But if by not var-ing, you
> run the risk of variable overwriting when calling cfcs from other cfcs,
> then why is it "more local" or "private" not to var?

For example:

The CFC contains 3 functions, f1, f2 and f3 ( just to be creative :)

and you scope the local variables for these functions as such:

f1 {
f1.var1
f1.var2
f1.var3 
}

f2 {
f2.var1
f2.var2 
}

f3 {
f3.var1 
}

this way you don't get the cross-talk you might otherwise get with using this.var1 or 
this.var2 in your functions.

Isaac Dealey

www.turnkey.to
954-776-0046
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Using THIS scope in CFCs

2002-07-17 Thread Patti G. L. Hall

> That being said - you can use a 'pseudo' private scope in CFCs by not
> using var or This. In ways, it acts like a local Variables scope for

Wait... I just got confused.  Why is it more private if you don't var the
variable?  I get the "This" aspect just fine.  But if by not var-ing, you
run the risk of variable overwriting when calling cfcs from other cfcs, then
why is it "more local" or "private" not to var?

> CFCs (although you can't dump it). This can be useful for CFC data that
> you want to store - but keep private.

Or, did I just completely misunderstand?

-Patti

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Hal Helms

Simon,

Why don't you think files should be included in CFCs? I'm interested in
hearing why you think that violates the OO paradigm.

Hal

-Original Message-
From: Simon Horwith [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 17, 2002 4:42 PM
To: CF-Talk
Subject: RE: Using THIS scope in CFCs


the only comment I have is that if you are using components to build
object modeled applications, you shouldn't be including files from cfcs.
My opinion is that components are not just another code re-use
constructthey're an entirely different beast.  If you are using
them, you should know "object think".

~Simon

Simon Horwith
Macromedia Certified Instructor
Certified Advanced ColdFusion 5 Developer
Fig Leaf Software
1400 16th St NW, # 500
Washington DC 20036
202.797.6570 (direct line)
www.figleaf.com



-Original Message-
From: Stacy Young [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 4:25 PM
To: CF-Talk
Subject: Using THIS scope in CFCs


I'm using THIS scope in my included files used within my CFCs since the
argument scope is not available. (I believe is known issue). The
downside to this is I have to append the argument scope.

I was previously using ATTRIBUTES scope but I figure THIS is safer...

 

Comments/suggestions?

 



AVIS IMPORTANT: 
---
Les informations contenues dans le present document et ses pieces
jointes sont strictement confidentielles et reservees a l'usage de la
(des)
personne(s) a qui il est adresse. Si vous n'etes pas le destinataire,
soyez avise que toute divulgation, distribution, copie, ou autre
utilisation de ces informations est strictement prohibee.  Si vous avez
recu ce document par erreur, veuillez s'il vous plait communiquer
immediatement avec l'expediteur et detruire ce document sans en faire de
copie sous quelque forme.

WARNING:  
---
The information contained in this document and attachments is
confidential and intended only for the person(s) named above.  If you
are not the intended recipient you are hereby notified that any
disclosure, copying, distribution, or any other use of the information
is strictly prohibited. If you have received this document by mistake,
please notify the sender immediately and destroy this document and
attachments without making any copy of any kind.




__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Raymond Camden

Alo bare in mind that the This scope is 'public' to the caller. Ie, if I
make an instance of your CFC, and you set this.name to 'foo', I can
output yourcfc.name in my code. So, don't put anything sensitive there.

That being said - you can use a 'pseudo' private scope in CFCs by not
using var or This. In ways, it acts like a local Variables scope for
CFCs (although you can't dump it). This can be useful for CFC data that
you want to store - but keep private.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Simon Horwith [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, July 17, 2002 4:42 PM
> To: CF-Talk
> Subject: RE: Using THIS scope in CFCs
> 
> 
> the only comment I have is that if you are using components 
> to build object modeled applications, you shouldn't be 
> including files from cfcs.  My opinion is that components are 
> not just another code re-use constructthey're an entirely 
> different beast.  If you are using them, you should know 
> "object think".
> 
> ~Simon
> 
> Simon Horwith
> Macromedia Certified Instructor
> Certified Advanced ColdFusion 5 Developer
> Fig Leaf Software
> 1400 16th St NW, # 500
> Washington DC 20036
> 202.797.6570 (direct line)
> www.figleaf.com
> 
> 
> 
> -----Original Message-
> From: Stacy Young [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 4:25 PM
> To: CF-Talk
> Subject: Using THIS scope in CFCs
> 
> 
> I'm using THIS scope in my included files used within my CFCs 
> since the argument scope is not available. (I believe is 
> known issue). The downside to this is I have to append the 
> argument scope.
> 
> I was previously using ATTRIBUTES scope but I figure THIS is safer...
> 
>  
> 
> Comments/suggestions?
> 
>  
> 
> 
> 
> AVIS IMPORTANT: 
> ---
> Les informations contenues dans le present document et ses 
> pieces jointes sont strictement confidentielles et reservees 
> a l'usage de la (des)
> personne(s) a qui il est adresse. Si vous n'etes pas le 
> destinataire, soyez avise que toute divulgation, 
> distribution, copie, ou autre utilisation de ces informations 
> est strictement prohibee.  Si vous avez recu ce document par 
> erreur, veuillez s'il vous plait communiquer immediatement 
> avec l'expediteur et detruire ce document sans en faire de 
> copie sous quelque forme.
> 
> WARNING:  
> ---
> The information contained in this document and attachments is 
> confidential and intended only for the person(s) named above. 
>  If you are not the intended recipient you are hereby 
> notified that any disclosure, copying, distribution, or any 
> other use of the information is strictly prohibited. If you 
> have received this document by mistake, please notify the 
> sender immediately and destroy this document and attachments 
> without making any copy of any kind.
> 
> 
> 
> 
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Stacy Young

Oh I agree...but in the case of creating a series of "Data Access Objects" I
think it's perfectly acceptable to CFINCLUDE long queries to maintain
readability in the CFC.

Cheers!


-Original Message-
From: Simon Horwith [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 17, 2002 4:42 PM
To: CF-Talk
Subject: RE: Using THIS scope in CFCs

the only comment I have is that if you are using components to build object
modeled applications, you shouldn't be including files from cfcs.  My
opinion is that components are not just another code re-use
constructthey're an entirely different beast.  If you are using them,
you should know "object think".

~Simon

Simon Horwith
Macromedia Certified Instructor
Certified Advanced ColdFusion 5 Developer
Fig Leaf Software
1400 16th St NW, # 500
Washington DC 20036
202.797.6570 (direct line)
www.figleaf.com



-Original Message-
From: Stacy Young [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 4:25 PM
To: CF-Talk
Subject: Using THIS scope in CFCs


I'm using THIS scope in my included files used within my CFCs since the
argument scope is not available. (I believe is known issue). The downside to
this is I have to append the argument scope.

I was previously using ATTRIBUTES scope but I figure THIS is safer...

 

Comments/suggestions?

 



AVIS IMPORTANT: 
---
Les informations contenues dans le present document et ses pieces jointes
sont strictement confidentielles et reservees a l'usage de la (des)
personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez
avise que toute divulgation, distribution, copie, ou autre utilisation de
ces informations est strictement prohibee.  Si vous avez recu ce document
par erreur, veuillez s'il vous plait communiquer immediatement avec
l'expediteur et detruire ce document sans en faire de copie sous quelque
forme.

WARNING:  
---
The information contained in this document and attachments is confidential
and intended only for the person(s) named above.  If you are not the
intended recipient you are hereby notified that any disclosure, copying,
distribution, or any other use of the information is strictly prohibited.
If you have received this document by mistake, please notify the sender
immediately and destroy this document and attachments without making any
copy of any kind.




__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Using THIS scope in CFCs

2002-07-17 Thread Simon Horwith

the only comment I have is that if you are using components to build object
modeled applications, you shouldn't be including files from cfcs.  My
opinion is that components are not just another code re-use
constructthey're an entirely different beast.  If you are using them,
you should know "object think".

~Simon

Simon Horwith
Macromedia Certified Instructor
Certified Advanced ColdFusion 5 Developer
Fig Leaf Software
1400 16th St NW, # 500
Washington DC 20036
202.797.6570 (direct line)
www.figleaf.com



-Original Message-
From: Stacy Young [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 4:25 PM
To: CF-Talk
Subject: Using THIS scope in CFCs


I'm using THIS scope in my included files used within my CFCs since the
argument scope is not available. (I believe is known issue). The downside to
this is I have to append the argument scope.

I was previously using ATTRIBUTES scope but I figure THIS is safer...

 

Comments/suggestions?

 



AVIS IMPORTANT: 
---
Les informations contenues dans le present document et ses pieces jointes
sont strictement confidentielles et reservees a l'usage de la (des)
personne(s) a qui il est adresse. Si vous n'etes pas le destinataire, soyez
avise que toute divulgation, distribution, copie, ou autre utilisation de
ces informations est strictement prohibee.  Si vous avez recu ce document
par erreur, veuillez s'il vous plait communiquer immediatement avec
l'expediteur et detruire ce document sans en faire de copie sous quelque
forme.

WARNING:  
---
The information contained in this document and attachments is confidential
and intended only for the person(s) named above.  If you are not the
intended recipient you are hereby notified that any disclosure, copying,
distribution, or any other use of the information is strictly prohibited.
If you have received this document by mistake, please notify the sender
immediately and destroy this document and attachments without making any
copy of any kind.



__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



  1   2   >