trust that the users of your code won't reset it.  If you really care,
use a getter method, as that's immutable.

cheers,
barneyb

On 7/6/05, Haikal Saadh <[EMAIL PROTECTED]> wrote:
> Hello all.
> 
> What's the closest thing CF has to "public static final" in java?
> 
> For example, I am writing a logging compoent, and I want to declare some
> constants:
> 
> <cfcomponent name="Log">
>     <cfscript>
>         this.DEBUG = 0;
>         this.INFO = 10;
>          // and so on..
>     </cfscript>
> </cfcomponent name="Log">
> 
> 
> The idea being that in the client code, I can do something like:
> 
>     myLogInstance.setLogLevel(Log.DEBUG); // I'm aware that Log.DEBUG will
>                                           // fail, as CF doesn't have static
>                                           // vars either
> 
> 
> Now, the trouble with using /this/ is that someone can come along and
> reassign the values and it will all end in tears.
> What practice does the Rest Of The World use for similar situations?
> 


-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.


----------------------------------------------------------
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).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to