I like the idea. I do .net and C# development and
static methods are very useful. I would really like to see them in
BlueDragon.
Thanks
Tom
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vince Bonfanti
Sent: Friday, July 21, 2006 8:40 AM
To: [email protected]
Subject: [CFCDev] Static CFC methods
(The following is a duplicate of a blog entry I just
posted. I assume not everyone reads my blog, and I'm very interested in getting
feedback from this group in particular, so I hope no one minds that I
reproduced the blog entry here).
We're
wrapping up our implementation of abstract CFCs and CFC interfaces in BlueDragon
7.0, when the notion of implementing support for static CFC methods was raised
once again. I'm curious to know how many people would be interested in this;
along with abstract CFCs, interfaces, and support for "null", supporting static
CFC methods would seem to round out our object-oriented enhancements in
BlueDragon 7.0.
The main benefit
of static CFC methods is the ability to invoke them without creating a CFC
instance. That is, they'd work pretty much the same as a CFFUNCTION declared
within a page, but could be encapsulated within a CFC. Here are some thoughts on
how static methods might work:
- static methods can be invoked using CFINVOKE
- invoking a static method via CFINVOKE does not render the CFC
pseudo-constructor or create an instance of the CFC
- static methods can be invoked on CFC instances the same way as any
non-static method
- static methods cannot access the CFC "this" scope
- static methods cannot invoke non-static methods within the same
CFC
- static methods are specified via CFFUNCTION
TYPE="static"
We could possibly
also add a new CFML function that will invoke a static method without creating a
CFC instance or rendering the CFC pseudo-constructor:
<cfset returnVar = InvokeStatic( "component.name", "methodName",
parm1, parm2 )>
So, what do you think? Should we try to fit this into BlueDragon
7.0?
Vince Bonfanti
New Atlanta Communications,
LLC
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.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' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
