Vincent Vandenschrick wrote:
> Hi Fabian,
> I catch up the discussion ;-)
> Could you elaborate on the difference between "use" and "require" ?

"use" affects run-time requirements, "require" affects load-time 
requirements. To put it plain, a "use"d class has to be loaded in the 
application, no matter where. A "require"d class has to be loaded 
*before* the current class.

>  What 
> kind of use case would make it mandatory to use "require" instead of 
> "use" ?

If you call a static method to initialize a property:

  foo : a.b.c.someMeth()

the class a.b.c will be added to the list of "require"d classes for the 
current, because it has to be available at load-time. But if the method 
a.b.c.someMeth depends on another class, say a.b.d, this is a run-time 
dependency, and is currently not detected as being "promoted" to a 
load-time dependency through the transitive use in the current class. In 
this case you would #require(a.b.d) in the current class.

>  What does it imply in terms of generated JS ?

"use"d classes are included somewhere, "require"d classes before the 
current class.

>  Maybe you can just 
> point me to some doc about the compiler directives that can be used.
>   

Unfortunately, there is no comprehensive documentation about the current 
compiler hints (the one for qooxdoo 0.7 [1] is too old to be useful). 
But these are the hints of interest:

#use  -- make sure the class is in the build
#require -- make sure the class is in the build before the current
#asset  -- register these resources with the application (allows for 
wildcards and "asset-let" macros [2])

HTH,
T.


[1] http://qooxdoo.org/documentation/0.7/custom_builds#developer
[2] 
http://qooxdoo.org/documentation/0.8/generator_config_articles#asset-let_key

> Regards,
> Vincent
>
> Fabian Jakobs a écrit :
>   
>> Hi Andreas,
>>
>> The generator is very picky about the statment. It expects them to be at 
>> the start of the line. We usually place them in the header of the file.
>>
>> The difference between "use" and "require" is that "use" establishes a 
>> runtime dependency and "require" the stricter load time dependency.
>>
>> Fabian
>>   
>>     

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to