Sorry my mistake.
return type of foo() and bar() is int.
So now
public void onClick(Clickevent e) {
GWT.runAsynck(
public void onSuccess() {
int x = foo();
int y = bar(x);
goo(z);
}
);
}
public int foo() {
}
public int
You are correct: the code you pasted has only one split point and (provided
they are not called from anywhere else), foo(), bar() and goo() sit behind
that split point -- it means they will only be loaded when onClick is
called. [That's what the sentence you highlighted in red means.]
If you
Ok.
Suppose any of these methods foo(), bar() or goo() use some class
variable, global variable or some variable defined in another class
then how does it affect code splitting here?
On 2/23/11, Philippe Beaudoin philippe.beaud...@gmail.com wrote:
You are correct: the code you pasted has only
From what I understand, code-splitting must be thought about in a
method-by-method basis. That is, the variables you use is not important, but
the method you call on it is. In short:
- If all calls to methodA() happen behind the _same_ split point then
methodA() will be part of that fragment
You could also use a 'proxy' version of the return type.
--
You received this message because you are subscribed to the Google Groups
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to
Could you pls explain how to use this proxy version?
On Tue, Feb 22, 2011 at 1:52 PM, John Maitland
jfgmaitl...@googlemail.comwrote:
You could also use a 'proxy' version of the return type.
--
You received this message because you are subscribed to the Google Groups
Google Web Toolkit
@Deepak I read your question too quickly, my answer does not apply and I've
deleted the message. Sorry for the confusion.
--
You received this message because you are subscribed to the Google Groups
Google Web Toolkit group.
To post to this group, send email to
One thing that is not obvious at first is that code splitting part of your
application that performs computation is far from trivial and will sometimes
require you to change your code in deep ways. That's because you have to
switch your mindset from regular linear programming to deferred
Thank you Phillipe, now its more clear.
Now lets suppose the following scenario,
public void onClick(Clickevent e) {
GWT.runAsynck(
public void onSuccess() {
int x = foo();
int y = bar(x);
goo(z);
}
);
}
public void foo() {
The way you write it does not worl:
int x = foo();
expects foo() to return an int, but it's declared as returning void.
You do not need to runAsync in foo, bar and goo provided you're only calling
them from one place (onClick). If you're always calling them in succession,
you should always
Hi,
How to set code splitting for entire body of methods with return type other
than void as void onSuccess() will not allow to return anything?
public Object myMethod() {
//
Object object = new Object();
// method body
return object;
}
After we code split point as,
public Object myMethod()
Have you tried Void? (with a capital V)
--
You received this message because you are subscribed to the Google Groups
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to
You cannot return something from an async call like that. The work
will be done asynchronously, and the main program has presumably gone
on its merry way while the async things are being done.
If some object needs that result, a simple solution would be to pass
the object into the async method,
@Phillipe,
Void? Could you pls tell about this. It is also not recognised by program.
@Ben
So if i put some lines of the method body within onSucces() then will the
code split for this portion of method be succesful?
On Tue, Feb 22, 2011 at 1:51 AM, Ben Imp benlee...@gmail.com wrote:
You
The code split would likely still work, depending on how you reference
things. Try it and see.
-Ben
On Feb 21, 2:51 pm, Deepak Singh deepaksingh...@gmail.com wrote:
@Phillipe,
Void? Could you pls tell about this. It is also not recognised by program.
@Ben
So if i put some lines of the
15 matches
Mail list logo