I'd consider it a "bad thing". At some point you have to determine what the value of cfcMethodNameIWant should be set to, so you should be able to use that same logic to actually call the appropriate method directly.
That being said, I've resorted to a few "bad things" in certain instances. Just because it's a "bad thing" doesn't mean it doesn't have a place, ya know? Cheers, barneyb > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Nathan Dintenfass > Sent: Friday, May 14, 2004 8:18 PM > To: [EMAIL PROTECTED] > Subject: [CFCDev] Dynamic calling of CFC methods: opinions? > > I find that I occasionally end up wanting to dynamically > decide which method > of a CFC to call. It ends up looking something like: > > cfcInstance.tempMethodName = cfcInstance[cfcMethodNameIWant]; > cfcInstance.tempMethodName(whateverArgs); > structDelete(cfcInstance,"tempMethodName"); > > It always feels like a gigantic hack when I do it, but it > sure has come in > handy in a couple places. In a perfect world, I guess I'd > build some kind > of facades with template methods that are known in advance, > but that's not > always practical. > > Any opinions on this practice? Is it a "bad thing"? > > Thanks, > > - Nathan > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at > www.mail-archive.com/[EMAIL PROTECTED] > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
