>> is declared in the beginning of the class. The question is if it is
>> possible to sectionize it even further i.e. more related to the specific
>> function where is it used? Now it is related to the whole class i.e. local
>> to the whole class.

>Due to the dynamic nature of JavaScript it is very hard to predict which
>functions will be used at run time and which not.

Of course and we know that very well.

I didn't really mean that. Let me explain again. By using scope

(function() {
  qooxdoo local string declarations for all functions below etc.
  qooxdoo class declaration {
    function 1
    function 2
    function n
  }
})();

the local string declarations are connected to the whole class. It means even 
the strings for not executed functions will be executed.
If we forget to predict what functions will be executed, which is as you said 
impossible, and instead look at if there is any other way to 
make the string declarations scoped to the functions. Is there any reasonable 
way of doing that?

Putting another anonymous scope function around can not be reasonable, like 
this I guess:

(function() {
  qooxdoo class declaration {
   (function() {
    qooxdoo local string declarations for only current function
    function 1
   })();
   (function() {
    qooxdoo local string declarations for only current function
    function 2
   })();
   (function() {
    qooxdoo local string declarations for only current function
    function n
   })();
  }
})();

but is there any other way to make it local to the function? A pure global 
string/lexical table instead of local variable declarations?

Probably not...so the cost of declaring all strings for all functions before 
the class definition is probably the least bad solution.
Then this has to be in mind when developing the classes and NOT make them to 
big and instead spread the memory and speed cost over several classes.

Stefan
                                          
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to