Tuesday, June 11, 2013

Re: Application architecture question

@Timea RequestBuilder or RequestFactory.

If you plan on creating a Mobile "Web" App you can def. look at GWT-RPC. However, if you plan on packaging the App to "Native" as part of the dual mode (web-"native"), then avoid if possible GWT-RPC.

Regards,

Alfredo


On Tue, Jun 11, 2013 at 3:41 PM, Imy <timea.turdean@gmail.com> wrote:
Thank you for the so far posted replies.

For maybe further clarify:
  • I need this to work only at the start up of the application, to wait till my model has all the data and then update the GUI.
  • I am using mGWT, still the architecture is GWT related. I am using mGWT to get it cross-device and GWT to get it cross-browser. (of course with its limitations)
  • let's say I can control the RPC calls, what do I do with all the events? Can I control my application only to move on when all the necessary events are done? 

@Alfredo - if not gwt-rpc, then what?

Cheers,
Timea

On 11 June 2013 21:30, Alfredo Quiroga <lawwton@gmail.com> wrote:
And since the last sentence of the original post if my memory serves me right mentions is for a mobile app I would strongly recommend not to use gwt-rpc in this case.

Sent from my iPhone

On Jun 11, 2013, at 3:24 PM, Jens <jens.nehlmeier@gmail.com> wrote:

If you have multiple independent RPC requests and you want to update the GUI after all these RPC requests are done, then you could check a number of boolean variables (one per RPC request) to see if all of them are true ( = RPC is done), e.g.

server.rpcMethod1(Callback() {
  onSuccess() {
    rpcMethod1Done = true;
    maybeUpdateUI();
  }
});

server.rpcMethod2(Callback() {
  onSuccess() {
    rpcMethod2Done = true;
    maybeUpdateUI();
  }
});

private void maybeUpdateUI() {
  if(allRpcDone()) { //check all boolean variables.
    //... update ui
  }
}

But as you have a mobile application its probably better to batch your requests, so that your app, as a rule of thumb, only does one request per screen. This saves a lot of network overhead. In this case a command pattern might be useful, as it allows for easy BatchCommands, e.g.

BatchCommand bc = new BatchCommand();
bc.add(new DoStuff1Command());
bc.add(new DoStuff2Command());

server.execute(bc, Calllback<BatchCommandResult>() {
  //in onSuccess iterate over all individual command results contained in the BatchCommandResult and finally update your UI.
}



Otherwise, if you just have a single RPC request somewhere and you make that RPC request because of an event you probably just need an XyzLoadedEvent, e.g. ScoreBoardRequestEvent and ScoreBoardLoadedEvent, just like Joseph has already explained.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.

To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/eZLxnlpixL0/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscribe@googlegroups.com.

To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate