Saturday, December 3, 2011

Re: GWT MVP & Multiple Areas Doubt

If your 3 parts are tightly linked (you have different actions and different filters for each different "main content"), given that they're displayed next to each other, then you only need one activity.

I'd however try to code them as three distinct "components" (widgets) linked only through events (true events with event-handlers using addHandler, or simply using callbacks). That should make it easier maintain the whole thing (otherwise your "main content with actions and filters" could grow and become unmaintainable) but more importantly, if you think you could visually separate them later, that would make it easier (in that event, route the events through the event bus and "you're done"). It would make it possible/easier to reuse one part in different views (e.g. if most/all lists have the same set of actions).

I'm afraid there's no "one size fits all" approach; it (in part) depends how you imagine your app will evolve. The whole idea of activities are to decouple things, it doesn't make sense for things that are tightly coupled (unless they're separated visually into non-adjacent areas). The idea is that, for instance, a "main menu", a "list of things" and "details about one thing" could all appear on the screen at the same time on a desktop, but appear as "sequential screens" on a smart phone (and using MVP within an activity, you can in addition decouple the view –wide on a desktop, narrower on a smartphone– from the behavior)

To me, however, your current design is clearly not the best (or i misunderstood it): why use MainDisplayFilters and MainDisplayActions as singletons that you clear/populate each time instead of simply using distinct instances in each view?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/bqGmcv_OB8EJ.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate