Re: CFC Typeof()

2007-06-15 Thread Rupesh Kumar
Enter CF8 and we have added IsInstanceOf(object, Type) to do the same. It checks whether the given object is of given type where the type is a component or interface. Regarding MetaData for components, we have also added a new Method GetComponentMetaData(componentOrInterface). As opposed to

Re: CFC Typeof()

2007-06-15 Thread Rupesh Kumar
Enter CF8 and we have added IsInstanceOf(object, Type) to do the same. It checks whether the given object is of given type where the type is a component or interface. Regarding MetaData for components, we have also added a new Method GetComponentMetaData(componentOrInterface). As opposed to

Re: CFC Typeof()

2007-06-15 Thread Gert Franz
Hi Rupesh, is IsValid() supported as well? Meaning somethin like: isValid(object/interface, value) Greetings / GrĂ¼sse Gert Franz Customer Care Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List / Treten Sie unserer Mailingliste bei: deutsch:

Re: CFC Typeof()

2007-06-07 Thread Barney Boisvert
I'm inclined to disagree. getMetaData is cached, so while the first invocation may require some additional overhead, subsequent calls just return the already-existing object straight away, so they're blindingly fast. This also means that you can cache your own metadata in the metadata struct if

Re: CFC Typeof()

2007-06-07 Thread Robertson-Ravo, Neil (RX)
-Original Message- From: Barney Boisvert To: CF-Talk Sent: Thu Jun 07 07:28:51 2007 Subject: Re: CFC Typeof() I'm inclined to disagree. getMetaData is cached, so while the first invocation may require some additional overhead, subsequent calls just return the already-existing object straight away, so

Re: CFC Typeof()

2007-06-07 Thread Robertson-Ravo, Neil (RX)
: Judith Dinowitz To: CF-Talk Sent: Thu Jun 07 04:02:48 2007 Subject: Re: CFC Typeof() For more on duck typing, you might want to check out Fusion Authority Quarterly Update Volume 1 Issue 1 (PDF for free): http://www.fusionauthority.com/quarterly/FAQU-Vol1-Issue1.pdf Judith Dinowitz Editor-in-Chief

Re: CFC Typeof()

2007-06-07 Thread Brian Kotek
The reason I thought it would be slower is that I recall someone trying to write a way of allowing interfaces in CFCs that relied on calls to getMetaData() to look up method signatures and such, and I remember that it was very slow. I wrote a simple test to check it out. While the results aren't

RE: CFC Typeof()

2007-06-07 Thread Jim Davis
-Original Message- From: Brian Kotek [mailto:[EMAIL PROTECTED] Sent: Thursday, June 07, 2007 10:36 AM To: CF-Talk Subject: Re: CFC Typeof() The reason I thought it would be slower is that I recall someone trying to write a way of allowing interfaces in CFCs that relied on calls

RE: CFC Typeof()

2007-06-07 Thread Robertson-Ravo, Neil (RX)
Huzzah for cfinterface ;-p Yeah yeah I know...CF is not Java... -Original Message- From: Brian Kotek [mailto:[EMAIL PROTECTED] Sent: 07 June 2007 15:36 To: CF-Talk Subject: Re: CFC Typeof() The reason I thought it would be slower is that I recall someone trying to write a way

CFC Typeof()

2007-06-06 Thread Scott Stewart
Hey all, This question was posed to me by one of my colleagues. I don't have an answer for him, but I'm hoping someone on the list does. Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com

Re: CFC Typeof()

2007-06-06 Thread Bryan Stevenson
Hey all, This question was posed to me by one of my colleagues. I don't have an answer for him, but I'm hoping someone on the list does. Thanks Is that like asking the doctor..I have a friend that has this weird rash? ;-) Sorry Scott...couldn't resist! Carry on Bryan Stevenson

Re: CFC Typeof()

2007-06-06 Thread Barney Boisvert
Writing an 'instanceOf' method in a base class (perhaps component.cfc, if you've got access) is very straightforward. Just use the CFC metadata to scan up the inheritance chain and see if the type in question matches anything. With CF8, you'll also need to account for interfaces, but that should

Re: CFC Typeof()

2007-06-06 Thread Jake Pilgrim
You don't want to do that in Coldfusion - it is unnecessary and is actually a performance hit as well. Read up on 'duck typing' - Sean Corfield has a nice powerpoint that outlines this concept. You have to remember that Coldfusion does not enforce strict typing; Coldfusion is not Java!! The

Re: CFC Typeof()

2007-06-06 Thread Judith Dinowitz
For more on duck typing, you might want to check out Fusion Authority Quarterly Update Volume 1 Issue 1 (PDF for free): http://www.fusionauthority.com/quarterly/FAQU-Vol1-Issue1.pdf Judith Dinowitz Editor-in-Chief: Fusion Authority http://www.fusionauthority.com - Original Message -

Re: CFC Typeof()

2007-06-06 Thread Zaphod Beeblebrox
regardless of whether or not CF is duck typed or dynamic, the dynamic languages I've used have all had this ability. Say you have an cfc that expects a vehicle, you send it a bike and you send it a car, both are vehicles, but both behave differently in some aspects. They may both have a 'go',

RE: CFC Typeof()

2007-06-06 Thread Ryan, Terrence
: Zaphod Beeblebrox [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 11:14 PM To: CF-Talk Subject: Re: CFC Typeof() regardless of whether or not CF is duck typed or dynamic, the dynamic languages I've used have all had this ability. Say you have an cfc that expects a vehicle, you send

Re: CFC Typeof()

2007-06-06 Thread Brian Kotek
Actually I'm quite sure that a try/catch block would be much faster than calling getMetaData(), especially for CFCs with more than 1 or 2 levels of inheritance. On 6/6/07, Zaphod Beeblebrox [EMAIL PROTECTED] wrote: regardless of whether or not CF is duck typed or dynamic, the dynamic languages