On 03/29/2011 03:30 PM, Derrell Lipman wrote: > On Tue, Mar 29, 2011 at 09:29, Jagget <[email protected] > <mailto:[email protected]>> wrote: > > Oh, I'm confused. Should I use "use" or "require"? Both of them works. > > > Do what Thomas says. He's the expert in that area. > > Thomas, what exactly is the difference?
It's in line with other "use" and "require" uses (e.g. in the generator config): "use" means "I need it at run time", "require" means "I need it when I'm loaded". The difference is interesting, since "use" dependencies just need to be loaded in the application *somewhen*, while "require" dependencies need to be loaded *before* the current class. That means, using #require directly influences the load ordering of classes, while #use doesn't. Load ordering of classes is a tricky beast, as it forces the (load) dependency relations between classes into a directed acyclic graph. The more relations there are in the graph, the higher is the chance that its "dag" property is violated, and the more constraint is the graph's linearization. In the worst case, it might mean there is no linearization for the classes in the app, e.g. when you have a dependency cycle, and the generator will stop building it (dependency cycles are no problem with #use relations). So, what I meant to say was, try favor using #use over #require as much as possible, and #require only when it is definitely necessary :-). T. ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
