Re: j2s-development] [New Feature] Re: Dynamic Loading of JavaScript files
Brought to you by:
zhourenjian
|
From: Zhou R. <jo...@sj...> - 2006-07-15 12:52:43
|
If it is the known cyclic dependencies:
public abstract class A {
static A a = new B ();
}
class B extends A {
}
Java2Script compiler will not support this kind of dependency. This kind
of cyclic dependencies actually should be avoid by using lazy loading
methods.
Or other cyclic dependencies, please post the example codes.
Soheil Hassas Yeganeh wrote:
> I found a bug in this new feature. It does not support cyclic dependancy.
> x needs y and y needs x.
> Any idea?
>
> On 7/14/06, Zhou Renjian <jo...@sj...> wrote:
>
>> The Java2Script compiler will compile those implicit imports into
>> explicit imports.
>>
>> In JavaScript level of ClazzLoader.js, ClassLoader need to know the
>> exact classes to *.js path mappings, in which one *.js file may contains
>> more than one class.
>>
>> ClassLoader is designed to support other JavaScript object oriented
>> systems by overriding parts of codes, such as
>> ClazzLader.getClasspathFor. But this feature is not yet tested on other
>> complicate toolkits like dojo. And ClassLoader supports asynchronous
>> loading mode on both using "<SCRIPT>" or XMLHttpRequest, and also
>> support synchronous loading mode on XMLHttpRequest. In using "<SCRIPT>"
>> tag mode, classes can be loaded from different domains.
>>
>> I are wondering of writing some documents for these JavaScript level
>> deployment and configuration things. For pure Java programming, J2S will
>> provide wizards or configuration files for Java2Script compiler to
>> generate those JavaScript deployment and configuration codes.
>>
>>
>> Soheil Hassas Yeganeh wrote:
>>
>>> Sorry for my question. I've read the examples and seen it supports the
>>> package level class usage. Thanx for the great work of Zhou.
>>> Regards,
>>> Soheil
>>>
>>> On 7/14/06, Soheil Hassas Yeganeh <soh...@gm...> wrote:
>>>
>>>
>>>> Dear Zhou,
>>>>
>>>> Thanks for your great work. It was a must for Java2Script, and now you
>>>> made a great enhancement.
>>>> But, I have a question. Does the implemented ClassLoader support
>>>> loading package level classes that are used with no explicit import?
>>>>
>>>> Regards,
>>>> Soheil
>>>>
>>>> On 7/13/06, Zhou Renjian <jo...@sj...> wrote:
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> Finally, function of loading Java2Script's *.js files dynamically are
>>>>> implemented.
>>>>> From now on, programmers do not need to manage classes order to get
>>>>> Java2Script applications correctly run. That is to say, loading *.js is
>>>>> transparent to programmers.
>>>>>
>>>>> This feature will be the base technology of other coming features, such
>>>>> as earlier discussed Class.forName (...).
>>>>>
>>>>> And by loading Java2Script's *.js files dynamically, we can now generate
>>>>> a line of JavaScript code or a "javascript:..." link for a J2S
>>>>> application, which can be hosted inside other sites' HTML pages. Maybe
>>>>> we can call it "A Link An Application". Read more about this in the blog
>>>>> article: http://j2s.sourceforge.net/blog/2006/07/11/a-link-an-application/
>>>>>
>>>>> There are lots of bugs about this features. Some more tests may be required.
>>>>>
>>>>> Please check out the latest codes from SVN repository.
>>>>>
>>>>> And something should be mentioned:
>>>>> 1. Those lots of *.js in net.sf.j2s.lib/j2slib/.../*.js are generated
>>>>> from net.sf.j2s.java.core, net.sf.j2s.ajax and
>>>>> net.sf.j2s.java.org.eclipse.swt. You can run target j2slib.pack.lib of
>>>>> ant build j2s.core.build in project net.sf.j2s.lib to copy and pack the
>>>>> necessary files without checking out from the slow SVN.
>>>>> 2. Most of former *.z.js are removed. Only a new "j2slib.z.js" is left
>>>>> as the entry to all existed *.js units. So now, in the "Java2Script
>>>>> builder" property page "Add Libraries" button will open Dialog for
>>>>> choosing the only-one "j2slib.z.js" library. Just choose the library to
>>>>> make things work. And now "Add Resources", "Add Projects" and other
>>>>> buttons are now make no sense. And the those classes in the tree view
>>>>> also have no meanings now. These things will be removed or changed in
>>>>> the near future. For more details, please study the generated
>>>>> Java2Script application HTML file for more details.
>>>>> 3. ...
>>>>>
>>>>> I think later I need to write something to make the big change clear.
>>>>>
>>>>> Regards
>>>>>
>>>>> /js
>>>>>
>>>>> Soheil Hassas Yeganeh wrote:
>>>>>
>>>>>
>>>>>> I did not mean to use a method like the one used in dojo. I was just
>>>>>> arguing about the idea.
>>>>>> Implementing a method for import a Class( import java.util.* -->
>>>>>> j2s_import("java.util.*")), and an implementation for Class.forName(),
>>>>>> is really enough for dynamic loading of java2script. May be
>>>>>> implementing java.reflect.* would be better.
>>>>>> I think using a method like this, will provide us a dynamic loading
>>>>>> method with the developer transparency preserved.
>>>>>>
>>>>>> Regards,
>>>>>> Soheil
>>>>>>
>>>>>> On 6/15/06, Josson Smith <jo...@sj...> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Dynamic loading *.js will be complex things.
>>>>>>>
>>>>>>> And I know that dojo toolkit is using its dynamic loading mechanism of
>>>>>>> JavaScript files.
>>>>>>>
>>>>>>> For Java2Script,
>>>>>>> First, the number of *.js files is somewhat huge already. It is more
>>>>>>> than 200. Setup the connections will require a lot of extra times.
>>>>>>> Second, referencing, sub-referencing, and sub-sub-referencing, ... may
>>>>>>> reference most of the classes. It requires some algorithm to cut off
>>>>>>> those unnecessary sub-referencing until it's necessary.
>>>>>>> Third, Java programmers should not be required to know things about
>>>>>>> dynamic loading of JavaScript.
>>>>>>>
>>>>>>> More discussions are needed.
>>>>>>>
>>>>>>>
>>>>>>> Soheil Hassas Yeganeh wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Oh, a very nice doco! I found here :
>>>>>>>> http://ajaxpatterns.org/On-Demand_Javascript
>>>>>>>>
>>>>>>>> On 6/12/06, Soheil Hassas Yeganeh <soh...@gm...> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>> I've a proposal for loading javascript files, dynamically. Suppose we
>>>>>>>>> have a lot of javascript files generated. As it occures in many
>>>>>>>>> applications many of the javascript files are not used frequently.
>>>>>>>>> So, Now, if we want to run that application we have to import a lot of
>>>>>>>>> js files in the html. This will make the application very slow and
>>>>>>>>> heavy.
>>>>>>>>> So, we need a dynamic javascript loading mechanism. If we have this
>>>>>>>>> mechanism, we can also implement methods like Class.forName().
>>>>>>>>> We can use .z files generated by j2s to dynamically loading need
>>>>>>>>> javascript files for each class.
>>>>>>>>> In other words, we need something like the Bindows' BiScriptLoader.
>>>>>>>>> Regards,
>>>>>>>>> Soheil Hassas Yeganeh
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> j2s-development mailing list
>>>>>>>> j2s...@li...
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/j2s-development
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Regards
>>>>>>>
>>>>>>> /js
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> j2s-development mailing list
>>>>>>> j2s...@li...
>>>>>>> https://lists.sourceforge.net/lists/listinfo/j2s-development
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> j2s-development mailing list
>>>>>> j2s...@li...
>>>>>> https://lists.sourceforge.net/lists/listinfo/j2s-development
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> Using Tomcat but need to do more? Need to support web services, security?
>>>>> Get stuff done quickly with pre-integrated technology to make your job easier
>>>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>> _______________________________________________
>>>>> j2s-development mailing list
>>>>> j2s...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/j2s-development
>>>>>
>>>>>
>>>>>
>>> -------------------------------------------------------------------------
>>> Using Tomcat but need to do more? Need to support web services, security?
>>> Get stuff done quickly with pre-integrated technology to make your job easier
>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>> _______________________________________________
>>> j2s-development mailing list
>>> j2s...@li...
>>> https://lists.sourceforge.net/lists/listinfo/j2s-development
>>>
>>>
>>>
>>>
>>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> j2s-development mailing list
>> j2s...@li...
>> https://lists.sourceforge.net/lists/listinfo/j2s-development
>>
>>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> j2s-development mailing list
> j2s...@li...
> https://lists.sourceforge.net/lists/listinfo/j2s-development
>
>
>
|