If I define a static variable like this (especially for Arrays),

statics :
{
   TABLE_COLUMN_ARRAY : ["C1","C2","C3"]
}

This TABLE_COLUMN_ARRAY is passed to qx.ui.table.model.Remote.setColumns().

Is there a possibility for memory leak clearing the above array? I don't
know how Qooxdoo cleans the internal object (probably it could be behaviour
of browser). I have been using lot of CONSTANT variables as properties, for
which I could ideally use static constants.

For some languages like Java/C++, when an array is declared as public static
variable, the Garbage Collection may struggle to clear the Object from
memory because of static references outside.

Thanks.
Kanugula.


Matthew Gregory wrote:
> 
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/best-way-to-define-constants-within-qooxdoo-tp18845032p18860486.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


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