Friday, February 8, 2013

Re: How to "embrace" asynchrony in GWT apps?

Honestly I would not use an EventBus here.

I dont know the app itself and its data types but to me it seems like that RequestXyzData events will quickly become a burden (Event + Handler and its more difficult to navigate through code). These events are probably too specific, tied to a given screen/presenter and probably only a single class will listen for a single event type in ordner to fetch the correct data requested by that event. 
In that case you may end up having a 1..1 relationship between the data provider and its consumer/presenter and it would have been easier to just create a class that can fetch that data and make that class a dependency for a given presenter.

So I would try to go the facade way and give them good names, e.g. ScoreBoardDataProvider.getRankings(Callback<Rankings>). Maybe you just try both approaches and see what fits best for your app.

-- 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.
 
 

No comments:

Post a Comment