Peter - there is no way currently to implement static methods on a CFC.

You are correct in that you could create a singleton instead, and it is pretty much the best option for dealing with this scenario.

For static attributes, the only option you really have is to have public variables, with a developer limitation not to change them.  Otherwise, you may have to resort to getXXX() on your singleton to provide those attribute values.

Mark

On 3/6/06, Peter Bell <[EMAIL PROTECTED]> wrote:
I can see that sometimes you could have a class with valid instance specific methods that could also have certain methods that do not depend on the value of the attributes of a given instance. I'm guessing I'd probably just end up sticking them into an instanceService or making them regular methods, but was just wondering (a) if there is any way to create static methods within a class that also has instance methods and (b) if we lose any valid functionality if we don't have that option in CF.
 
Was also wondering if we have static final class variables (i.e. class as opposed to object specific constants) and again if anyone is missing them if they don't exist. Again I can see a separate "class" singleton such as an entityService being a work around (and from what I can tell, a better practice), but want to see if there's anything I'm not considering . . .
 
Any input from the crossover Java programmers on the list much appreciated!
 


--
E: [EMAIL PROTECTED]
W: www.compoundtheory.com
ICQ: 3094740 ----------------------------------------------------------
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