Re: CFC Newbie

2010-03-22 Thread Dave Watts
I'm trying to get out of MX non CFC world. I've now working with CF8 and want to start converting some of my things to use CFC's. Specifically how I can use forms to interact with CFC's to add/edit/delete data. I've read a few tutorials from adobe about them and what I've seen on a few blogs

Re: CFC Newbie

2010-03-22 Thread Tony Bentley
ask and you shall be enlightened: http://www.bennadel.com/blog/726-ColdFusion-Application-cfc-Tutorial-And-Application-cfc-Reference.htm ~| Want to reach the ColdFusion community with something they want? Let them know on

Re: CFC Newbie

2010-03-22 Thread Dave Watts
ask and you shall be enlightened: http://www.bennadel.com/blog/726-ColdFusion-Application-cfc-Tutorial-And-Application-cfc-Reference.htm While that's useful information to be sure, it doesn't address the original poster's question, which is about CFC use in general. Application.cfc is quite a

RE: CFC Newbie

2010-03-22 Thread Ben Forta
To: cf-talk Subject: Re: CFC Newbie ask and you shall be enlightened: http://www.bennadel.com/blog/726-ColdFusion-Application-cfc-Tutorial-And-App lication-cfc-Reference.htm While that's useful information to be sure, it doesn't address the original poster's question, which is about CFC use

RE: CFC Newbie

2010-03-22 Thread Scott Raley
Yep read those first Ben! -Original Message- From: Ben Forta [mailto:b...@forta.com] Sent: Monday, March 22, 2010 3:49 PM To: cf-talk Subject: RE: CFC Newbie These are old, but may answer the question: http://www.adobe.com/devnet/coldfusion/articles/intro_cfcs.html http

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread James Holmes
Yes, encapsulation is an important part of OO and yes many people don't care. If you want to maintain the encapsulation, don't set thigns in the THIS scope - use a setter method to set them in the VARIABLES scope (and a getter method to get them out again): cfscript newUser =

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread Aaron Roberson
What about the constructor function? Shouldn't I set the properties in the THIS scope when initializing a component? Also, what is the difference between the variables scope and the arguments scope withing a method? I have seen properties defined using the cfargument tag referenced in the method

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread James Holmes
The only use for THIS in an OO-based component is to return THIS at the end of the constructor. That returns the entire component for use as an instance. The properties will be in the VARIABLES scope; they can be used via getter and setter methods. This is where the ARGUMENTS scope comes in - the

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread Aaron Roberson
The only use for THIS in an OO-based component is to return THIS at the end of the constructor. That returns the entire component for use as an instance. In Java, the constructer is for providing arguments with default values. These default values can be the ones that are automaticly assigned

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread James Holmes
No, for the moment, forget THIS. cfargument name=this.name type=string default= cfset variables.name = this.name should be cfargument name=name type=string default= cfset VARIABLES.name = ARGUMENTS.name The life cycle of the instance depends on where you put it. Instantiate it in the session

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread Aaron Roberson
James, I am going to keep all of these threads, print them out, and go over them multiple times until I begin to grasp it all. I guess I won't be learning CFAJAX until I get CFC's down, which is proving to be quite a task and very lengthy process. Thanks again and again! -Aaron To instantiate

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread Rick Root
Aaron Roberson wrote: I am going to keep all of these threads, print them out, and go over them multiple times until I begin to grasp it all. I guess I won't be learning CFAJAX until I get CFC's down, which is proving to be quite a task and very lengthy process. CFCs are wonderful! If you

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread Aaron Roberson
Thanks Rick, I will surely take a look. -Aaron On 2/16/06, Rick Root [EMAIL PROTECTED] wrote: Aaron Roberson wrote: I am going to keep all of these threads, print them out, and go over them multiple times until I begin to grasp it all. I guess I won't be learning CFAJAX until I get

Re: CFC Newbie Question: Encapsulation

2006-02-16 Thread Rick Root
On 2/17/06, Aaron Roberson [EMAIL PROTECTED] wrote: In my Java book it says that if a method is public, a data filed could be assigned a value directly, BUT doing so violates an important principle of object-oriented programming -- that of data hiding using encapsulation. However, I have

Re: CFC newbie: trying the calendar API, getting error

2005-01-25 Thread Simeon Bateman
it looks like it is specifically coded to run from the calendar folder. Try creating a calendar folder and dropping all the files in that and running it again. I dropped the folder that unzipped from the download, into my webroot. called /calendar/sample/index.cfm and the whole app came to

Re: CFC Newbie Discussion.

2003-06-10 Thread Michael Tangorre
Let me point out the scope bug... using this scope exposes your data members outside of the cfc. In addition, the varibales scope is not the default for not providing a scope within a CFC. There is something known as the unknown scope. This unknown scope allows data members to be available to

Re: CFC Newbie Discussion.

2003-06-10 Thread Michael Tangorre
In terms of which is the most efficient way of calling a cfcs... I like to use CreateObject(objectname,component); Thinking about CFCs like classes in Java or C++ is natural for me, so I like to work in that mentality.. like Hal Helms points out. Keep in mind though, some hosting providers limit

Re: CFC Newbie Discussion.

2003-06-10 Thread Michael Tangorre
not unknown... obviosuly its known :-) known as nothing! That should read the unnamed scope. Sorry If I confused matters... - Original Message - From: Michael Tangorre [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 1:32 PM Subject: Re: CFC Newbie

RE: CFC Newbie Discussion.

2003-06-10 Thread Ian Skinner
Skinner Web Programmer BloodSource Sacramento, CA -Original Message- From: Michael Tangorre [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 10:32 AM To: CF-Talk Subject: Re: CFC Newbie Discussion. Let me point out the scope bug... using this scope exposes your data members outside

Re: CFC Newbie Discussion.

2003-06-10 Thread John Quarto-vonTivadar
Thinking about CFCs like classes in Java or C++ is natural for me, so I like to work in that mentality.. it might be more efficient to think of CFCs like CFCs, that way you can use their features effectively, and not be disappointed or disillusioned if CFCs do things you dont expect or dont do

Re: CFC Newbie Discussion.

2003-06-10 Thread jon hall
cfobject name=testObj component=test cfdump var=#testObj# cfset this.X = 12 cfset this.Y = 24 This part confuses me...this scoped variables refer to the object they are contained within. It looks like you are setting them outside of a cfc. All that will do is create a structure called this,

Re: CFC Newbie Discussion.

2003-06-10 Thread Michael Tangorre
, and probably for a person new to CFCs, keeping them focused on CFCs and not the relations to OO would be a good start. Mike - Original Message - From: John Quarto-vonTivadar [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 1:53 PM Subject: Re: CFC Newbie

RE: CFC Newbie Discussion.

2003-06-10 Thread Ian Skinner
hall [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:01 AM To: CF-Talk Subject: Re: CFC Newbie Discussion. cfobject name=testObj component=test cfdump var=#testObj# cfset this.X = 12 cfset this.Y = 24 This part confuses me...this scoped variables refer to the object they are contained

RE: CFC Newbie Discussion.

2003-06-10 Thread Raymond Camden
While I strongly urge folks to not use the This scope, I would _not_ call it a bug. The This scope works _exactly_ as advertised, it's just not the preferred way of storing data for a CFC. -Raymond Camen Let me point out the scope bug... using this scope exposes your data members outside

RE: CFC Newbie Discussion.

2003-06-10 Thread Ian Skinner
So what is the Preferred way to store data for a CFC? -- Ian Skinner Web Programmer BloodSource Sacramento, CA -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:20 AM To: CF-Talk Subject: RE: CFC Newbie Discussion. While I

Re: CFC Newbie Discussion.

2003-06-10 Thread jon hall
The this scope has always worked exactly as I expected, and I do prefer to use it to store data unless there is a specific reason not to. -- jon mailto:[EMAIL PROTECTED] Tuesday, June 10, 2003, 2:20:22 PM, you wrote: RC While I strongly urge folks to not use the This scope, I would _not_ RC

RE: CFC Newbie Discussion.

2003-06-10 Thread Andy Ousterhout
Here is a summary from a few previous emails: 1. Define properties(variables) as instance.X to prevent any outside view or editing of them. 2. Use getX methods to allow outside viewing, and setX methods to set the variable. 3. Define non-property variables used with each method through

Re: CFC Newbie Discussion.

2003-06-10 Thread Michael Tangorre
] Sent: Tuesday, June 10, 2003 2:30 PM Subject: RE: CFC Newbie Discussion. So what is the Preferred way to store data for a CFC? -- Ian Skinner Web Programmer BloodSource Sacramento, CA -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Tuesday

Re: CFC Newbie Discussion.

2003-06-10 Thread Christian Cantrell
On Tuesday, June 10, 2003, at 02:20 PM, Raymond Camden wrote: While I strongly urge folks to not use the This scope, I would _not_ call it a bug. The This scope works _exactly_ as advertised, it's just not the preferred way of storing data for a CFC. Raymond is correct. It is not a bug --

RE: CFC Newbie Discussion.

2003-06-10 Thread Raymond Camden
, and a powerful ally it is. - Yoda -Original Message- From: Christian Cantrell [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 12:40 PM To: CF-Talk Subject: Re: CFC Newbie Discussion. On Tuesday, June 10, 2003, at 02:20 PM, Raymond Camden wrote: While I strongly urge

RE: CFC Newbie Discussion.

2003-06-10 Thread Ian Skinner
/cfcomponent In this example, I get an error stating that the variable A is not defined? -- Ian Skinner Web Programmer BloodSource Sacramento, CA -Original Message- From: Christian Cantrell [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:40 AM To: CF-Talk Subject: Re: CFC

RE: CFC Newbie Discussion.

2003-06-10 Thread Raymond Camden
[mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 12:49 PM To: CF-Talk Subject: RE: CFC Newbie Discussion. Ahh, I understand now, the best practice we are talking about is protecting the state/variables of ones objects, but using private variables and functions to manipulate them

Re: CFC Newbie Discussion.

2003-06-10 Thread Michael Tangorre
. Hope this helps you. Mike - Original Message - From: Ian Skinner [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 2:49 PM Subject: RE: CFC Newbie Discussion. Ahh, I understand now, the best practice we are talking about is protecting the state

RE: CFC Newbie Discussion.

2003-06-10 Thread Ian Skinner
: Tuesday, June 10, 2003 11:57 AM To: CF-Talk Subject: Re: CFC Newbie Discussion. You are asking all the right quesitons to learn... keep asking. :-) to keep variables protected within functions, use: cfset var myvariable = something to keep variables protected to the cfc and functions within the cfc

Re: CFC Newbie Discussion.

2003-06-10 Thread Jeff
on 6/10/03 2:55 PM, Raymond Camden at [EMAIL PROTECTED] wrote: By the way, there is one more scope you should be convered with - and that is 'var' scoped method variables. Whenever you use a value in a method, a value that is NOT meant to exist in the CFC whole, you should use the var scope.

RE: CFC Newbie Discussion.

2003-06-10 Thread Raymond Camden
So this example was meant to show how to protect variables inside the method? If I follow correctly, you created a variable scoped to the 'var' scope (named myQuery), then set the variable equal to the value of the Query? Does this mean that, if I follow what you say below... Correct.

RE: CFC Newbie Discussion.

2003-06-10 Thread Ian Skinner
of the entire component? -- Ian Skinner Web Programmer BloodSource Sacramento, CA -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 12:38 PM To: CF-Talk Subject: RE: CFC Newbie Discussion. So this example was meant to show how

RE: CFC Newbie Discussion.

2003-06-10 Thread Raymond Camden
Two follow up questions. You can't directly use the var key word in the cfquery tag; cfquery name=var joe Correct. You also can't do cfset var ... after any line of real code. So, your first N lines of a method will be cfargument tags, then cfset var tags, then 'real' code. So,

RE: CFC newbie

2002-10-18 Thread Thomas Chiverton
cfinvoke component=com.locavista.gui method=header That should read com.local.gui sorry, mis-typed into Outlook, so still broken... ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription:

RE: CFC newbie

2002-10-18 Thread Michael Corbridge
create a CF mapping for 'com' -Original Message- From: Thomas Chiverton [mailto:thomas.chiverton;locavista.com] Sent: Friday, October 18, 2002 11:05 AM To: CF-Talk Subject: RE: CFC newbie cfinvoke component=com.locavista.gui method=header That should read com.local.gui sorry, mis

RE: CFC newbie

2002-10-18 Thread Mark A. Kruger - CFG
: RE: CFC newbie create a CF mapping for 'com' -Original Message- From: Thomas Chiverton [mailto:thomas.chiverton;locavista.com] Sent: Friday, October 18, 2002 11:05 AM To: CF-Talk Subject: RE: CFC newbie cfinvoke component=com.locavista.gui method=header That should read com.local.gui

RE: CFC newbie

2002-10-18 Thread Thomas Chiverton
create a CF mapping for 'com' Ahh, great ! That was it. Friday brain fade - the sub dir I was in was mapped, so the 'com' directory I created was in the wrong place. Moving it to the actual wwwroot worked a treat. Tom Chiverton You don't have to be a mad scientist to believe in ColdFusion

RE: CFC newbie

2002-10-18 Thread S . Isaac Dealey
=com.locavista.gui.header method=someMethod -Original Message- From: Michael Corbridge [mailto:mcorbridge;macromedia.com] Sent: Friday, October 18, 2002 10:21 AM To: CF-Talk Subject: RE: CFC newbie create a CF mapping for 'com' -Original Message- From: Thomas Chiverton

RE: CFC newbie question

2002-09-05 Thread Michael Corbridge
Ali, Here is a stripped down version of your cfc that works with the native 'exampleapps' datasource that is shipped with CFMX. Notes: You have set the method access='private' which means that method can only be called from another method in the component. When starting out with cfc's, I

RE: CFC newbie question

2002-09-05 Thread Michael Corbridge
h... all the example code was removed from my previous email. I'll try again. cftalk1.cfm --- cfinvoke component=cftalk1 method=sendMail emailid=Raymond returnVariable=r_return cfdump var=#r_return# cftalk1.cfc

RE: CFC newbie question

2002-09-05 Thread Raymond Camden
: cfjedimaster My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Michael Corbridge [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 8:18 AM To: CF-Talk Subject: RE: CFC newbie question h... all the example code was removed from

RE: CFC newbie question

2002-09-04 Thread Raymond Camden
You forgot you # signs... cfmail subject=queryemail.tblemails_subject   to=queryemail.tblemails_to   from=queryemail.tblemails_from should be cfmail subject=#queryemail.tblemails_subject#   to=#queryemail.tblemails_to#   from=#queryemail.tblemails_from# Not a CFC issue - just a