Hi,
It is also advised that you make your constants all upper case. By doing 
this it reminds you, hopefully stopping you accidently changing one 
(remember these aren't truely constant) and it also let's the api viewer 
know it's a constant.

Matt

Kanugula wrote:
> Thanks Hugh.
> 
> I was not aware of this. I defined all my constants as properties and used
> getXXX().
> 
> Time to replace my code.
> 
> Thanks.
> Kanugula.
> 
> 
> Hugh Gibson wrote:
>>> How do you think I can best define my constants?
>> Use the "statics" keyword in a class definition.
>>
>> We also define class objects just for constants, like this one:
>>
>> qx.Class.define("abling.constants.CConference",
>>    {
>>    /*
>>    ********************************************************************
>>       STATICS
>>    ********************************************************************
>>    */
>>
>>    statics :
>>       {
>>       //
>>       // This set define whether a conference is public, private or
>>       // personal in the UI.
>>       //
>>       ePublicConference  : 0,                   // public conference
>>       ePrivateConference : 1,                   // private conference
>>       ePersonalFolder    : 2                    // personal folder
>>       }
>>    });
>>
>> Then we refer to them in the code with
>> abling.constants.CConference.ePublicConference for example.
>>
>> Hugh
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to