In addition to abstracting out how and where the data comes from, DataProviders also serve another important service. For instance, lets say you have 10 different views of the same data objects (Pojos). If you don't use a single DataProvider then all 10 views have to implement their own data providing plumbing. Instead, create a singleton dataprovider - list, async or whatever and share it among all views using the same data. Then, each view can filter on the actual instances of the Pojos it needs from the provider.
Besides the benefits already mentioned, here's another one: If you provide common data through a single DataProvider then only the DataProvider has to be interested in receiving global events related to the data such as when a Pojo is updated, deleted or added and then views only need to concern themselves with redrawing themselves.
Jeff
On Thu, Jan 27, 2011 at 12:06 PM, zixzigma <zixzigma@gmail.com> wrote:
I have included the relevant code from Roo generated Expenses app here: http://pastebin.com/2FUbaVjY
in onRangeChanged method,
getView().asHasData().setRowData(range.getStart(), values);
the code invokes setRowData on CellTable, and it makes use of onRangeChanged event,
and in fact displays dynamic data, but does not use AsyncDataProvider.
this contradicts with John LaBanca's comment ?
--
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 google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
Jeff Schwartz
--
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 google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment