Can someone provide me with an example of getters and setters with the code I provided? I found an example on the web, but I'm still a little more than confused.
http://www.daniweb.com/techtalkforums/thread13881.html Ryan On 5/9/05, Dan Blackman <[EMAIL PROTECTED]> wrote: > I just call it what it is...updateInsor like Daniel said obj. It > creates an instance of a class/component. > > As to using script or CFINVOKE...Script is definetly less coding. > > I agree on the getter and setter methods. > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Ryan Everhart > Sent: Monday, May 09, 2005 6:28 PM > To: [email protected] > Subject: Re: Opinions Needed: CFCs > > Daniel, > In your opinion what is the best practice, using cfscript or cfinvoke > to call a CFC? I like CFINVOKE because it's a lot less code, but I'm > not sure. Since I'm new to this I'd like to do it the best way from > the get go. > > Ryan > > On 5/9/05, Daniel Elmore <[EMAIL PROTECTED]> wrote: > > Since your not persisting that object across pages, it's not that big > of a > > deal. You could call it "obj" and it's just as readable. What's > important > > are the method (function) names. You should be using getters and > setters > > instead of the "this" scope. Easycfm will get you going on syntax and > usage, > > but IMHO, it will show you horrible architecture and design practices. > > > > In short, I think your code is fine, until you want to start designing > > applications around objects (ie. OOP). > > > > - Daniel > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf > > Of Ryan Everhart > > Sent: Monday, May 09, 2005 4:33 PM > > To: [email protected] > > Subject: Opinions Needed: CFCs > > > > Hey Everyone, > > I'm new at CFCs and I'm going off a tutorial I found on easycfm.com. > > I'm needing you opinion here on how you would name the component below > > > > <cfscript> > > // create a componet object > > updatePass = createObject("component","cfcs/password"); > > // now set the properties from our form > > updatePass.OldPassword = form.OldPassword; > > updatePass.NewPassword = form.NewPassword; > > updatePass.NewPassword2 = form.NewPassword2; > > updatePass.UID = client.UID; > > // now call the updatePass function to update the database > > updatePass.updatePass(); > > </cfscript> > > > > It's a simple update password component but I'm concerned that the > > component I created in the the code here is the named the same as the > > function the component is calling. Is this bad programming? What are > > you thoughts on a better component name. > > > > Ryan > > ---------------------------------------------------------- > > To post, send email to [email protected] > > To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > > To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > ---------------------------------------------------------- > > To post, send email to [email protected] > > To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > > To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > > ---------------------------------------------------------- > To post, send email to [email protected] > To unsubscribe: > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > To subscribe: > http://www.dfwcfug.org/form_MemberRegistration.cfm > > ---------------------------------------------------------- > To post, send email to [email protected] > To unsubscribe: > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > To subscribe: > http://www.dfwcfug.org/form_MemberRegistration.cfm > > ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
