GWT, MVP, GIN, code splitting?

381 views
Skip to first unread message

Ahmed

unread,
Jun 16, 2011, 12:08:08 PM6/16/11
to Google Web Toolkit
How to minimize the amount of code downloaded initially by GWT app
user's browser? Well, just wrap potentially big operations in a
GWT.runAsync() call. However, since our application is using GWT best
practices (dependency injection, MVP pattern), it’s not as
straightforward as GWT doc describes. Could you please give me an idea
on how to use code splitting in conjunction with GIN?

Juan Pablo Gardella

unread,
Jun 16, 2011, 12:10:05 PM6/16/11
to google-we...@googlegroups.com
+1

2011/6/16 Ahmed <ahmed....@gmail.com>

--
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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Raphael André Bauer

unread,
Jun 16, 2011, 12:13:13 PM6/16/11
to google-we...@googlegroups.com
Check out this issue (includes source code):
http://code.google.com/p/google-web-toolkit/issues/detail?id=5129

If you followed the best practises you can easily hide your activities
behind proxies that do the code splitting automatically.


Best,


Raphael

Thomas Broyer

unread,
Jun 16, 2011, 12:14:56 PM6/16/11
to google-we...@googlegroups.com
GIN's AsyncProvider might help.

If you're using Activities, you can also put GWT.runAsync in your Activity's start() method. See also http://code.google.com/p/google-web-toolkit/issues/detail?id=5129

Also, if you "embraced asynchrony", adding GWT.runAsync around already-asynchronous operations shouldn't be an issue.

Ahmed

unread,
Jun 17, 2011, 9:59:26 AM6/17/11
to Google Web Toolkit
First of all thank you for your reply:)
In fact I'm a beginner and I just discovered GWT and i dont
understand many pattern like the activity pattern but in regard to mvp
im using the GWT-Presenter
Framework.
brief the binding is done in this way

bindPresenter (
Presenter.class,
Presenter.Display.class,
View.class);

what should i do to optimize my code?
my binding code should it be something like this?
bind (Presenter.class). in (Singleton.class);
bind (Presenter.Display.class). toProvider (asyncProvider);

then have you an example of asynchronous provider and what do you
think about GWT Presenter is it was the right solution? or i have to
change to another framework? if you were me what would you have
chosen?

On 16 juin, 17:14, Thomas Broyer <t.bro...@gmail.com> wrote:
> GIN's AsyncProvider might help.
>
> If you're using Activities, you can also put GWT.runAsync in your Activity's
> start() method. See
> alsohttp://code.google.com/p/google-web-toolkit/issues/detail?id=5129

Thomas Broyer

unread,
Jun 17, 2011, 10:32:14 AM6/17/11
to google-we...@googlegroups.com
I don't know how they diverge, but GWT-Platform is originally a fork of GWT Presenter, and supports code splitting out of the box with just a few annotations here and there: http://code.google.com/p/gwt-platform/
Hint: search for "gwt-presenter" on the project's home page.
I never used either so i'm afraid I won't be of any help.
Reply all
Reply to author
Forward
0 new messages