Vince,
 
Most of our CFC-based code consists of static methods.  On application startup we use CreateObject to pin them in the Application scope to increase performance, then just call them as needed.
 
Would the BD7 technique you mention be similar to what CF does with components when called using the component name in CFINVOKE (rather than a reference), such that it creates and destroys an instance behind the scenes each time it is invoked (IIRC)?

Respectfully,

Adam Phillip Churvis
Certified Advanced ColdFusion MX 7 Developer
BlueDragon Alliance Founding Committee

Get advanced intensive Master-level training in
C# & ASP.NET 2.0 for ColdFusion Developers at
ProductivityEnhancement.com

----- Original Message -----
Sent: Friday, July 21, 2006 9:39 AM
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]

Reply via email to