>If you don't want the "name" variable to remain in the CFC between method calls, pass it in as per newJob.insertJob(name=form.name).
James, you just added a whole new dimension to my confusion. I know you didn't mean to, but what is the difference between setJob() and insertJob(). Obviously it must have something to do with the method within the cfc, but what? This brings me back to when to use a static component vs. instance components and rethinking how I write my methods and properties. I feel like one of those newbies that approaches CFC's, thinks he can do it, and then become hammered with confusion as psuedo code is flushed out. I just want to push forward and not draw back, but like so many others I have deadlines and I am already overdue. Somebody resue me! -Aaron On 2/16/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > I am looking at the following article by Rob Brooks-Bilson: > > http://www.oreillynet.com/pub/a/javascript/2003/09/24/coldfusion_tips.html > > I know it is an old article, so it may not be up to date with "best > practices." > > Anyways, I thought I had it down until I was introduced to the > psuedo-constructor and instantiation. I thought I could just create > arguements in my cfc's with the cfargument tag, and then pass the > cfc's the arguments when invoking them. While that is an option, it > seems to be the very basic of basic uses of CFC's and I am trying to > leverage OOP development the best I can in ColdFusion. > > I still don't really understand when I should create a static > component and when I should create an instance-based component. The > CFWACK book is very vaque, and documentation is sparce. > > Now that you guys are clearifying how to pass an instance component > arguments, I am begining to rethink my entire approach to writing > methods and properties. I really hate learning the wrong way to do > things first, and then learning how to do it right. > > Any help is very appreciated! > > -Aaron > > On 2/16/06, Alan Rother <[EMAIL PROTECTED]> wrote: > > I'm sorry, are you asking if you should use the variables scope in the CFC > > itself? > > > > If so, I don't recommend it. using variables. anything makes that variable > > available to all of the other methods in the cfc and basically trashes the > > thread safeness of the cfc, that is if you are using the cfc in a persistent > > scope. If you are instantiating the cfc evertime you use it, then it's ok, > > but under load it can really start to take a performance hit if you are > > invoking on every hit to the page. > > -- > > Alan Rother > > Macromedia Certified Advanced ColdFusion MX 7 Developer > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232659 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

