there is a clear distinction between *what
the browser needs* (DTO) and *what the business needs* (domain objects).
When you send JDO objects across the wire, you are sending your domain
model. Its not what the browser wants, and that is a problem. Soon, you will
have a presentational information in your domain model, and you will have
restricted information being sent to the browser, and it will be a big mess.
So, take a step back, and separate Domain objects from Presentation objects
(or DTOs). Make your RPCs revolve around a particular view, and send all
necessary information for that view in one RPC call. Note that now your
Person would include company name and company id, but not the entire company
object. Now, when the user clicks the company in the view, you make a RPC
call to get company information (because you have company id). That's it.
Works nicely, without having to make multiple calls.
Contents contributed and discussions participated by Esfand S
ContactsApplication - gwt-mosaic - 0 views
Interactive Application Architecture Patterns - 0 views
GUI Architectures - 1 views
GWT Best Practices - DevNexus 2010 - 0 views
Ray Ryan, best practices and embracing asynchronicity - Google Web Toolkit | Google Groups - 0 views
-
Doing this well depends on some form of centralized data retrieve dispatch/caching. You make calls to this centralized service to get the objects by id that you are interested in. It either finds them in cache and can return them immediately, or adds them to a queue of objects to retrieve. After all requests have been made (ie on DeferredCommand), a single request is sent to retrieve all objects of all types needed.
-
You could use an event bus to indicate all the objects where data is now available. This could even be a single event instead of one for each object, and the event handlers can ask if their objects of interest are now available, avoiding multiple updates.
Ray Ryan, best practices and embracing asynchronicity - Google Web Toolkit | Google Groups - 0 views
-
go with the asynch flow
-
object graphs should be avoided and domain objects should really just contain ids of their related objects. In the case of lists, this is to avoid sending too much useless info over the wire.
Large scale application development and MVP - Part II - 0 views
-
segment the code that declares the UI from the code that drives the UI.
-
we want the our ContactsPresenter to implement a Presenter interface that allows our ContactsView to callback into the presenter when it receives a click, select or other event. The Presenter interface defines the following: public interface Presenter<T> { void onAddButtonClicked(); void onDeleteButtonClicked(); void onItemClicked(T clickedItem); void onItemSelected(T selectedItem); }
-
The first part of wiring everything up is to have our ContactsPresenter implement the Presenter interface, and then register itself with the underlying view. To register itself, we'll need our ContactsView to expose a setPresenter() method: private Presenter<T> presenter; public void setPresenter(Presenter<T> presenter) { this.presenter = presenter; }
- ...8 more annotations...
GWT MVP Case Study - 0 views
« First
‹ Previous
201 - 212 of 212
Showing 20▼ items per page