Monday, November 29, 2010

Re: GWT 2.1 Activities – nesting? YAGNI ? - an example of where you NEED it !

Thank you for your comments.

>>So you would have one main activity for each major area with one view
>>and could have multiple widgets that accomplish what your individual
>>activities could?

I had thought about this, but my concern is by doing so, we lose the
navigation/history/bookmarking.

in the case of West Region having West North, West Main and West
South,
lets say we place three widgets in the West Region, and treat the
entire region as a single activity,

when we click an item in one of the regions (West Main for example),
selection of an item fires an event on eventBus,
the widget in West South is listening for this event, and upon
receiving,
populates itself with contextual data related to item selected in West
Main, however
since we are not using activities and places, the history token doesnt
get updated,
and we lose the history which results in poor/broken navigation.

more over, since we are not using Activities/Places for these sub-
regions (west_north, west_main, west_south),
we can not use placeController.go(new place), for communicating
events, and have to resort to manually creating event handling
(GwtEvent, etc)

what is your view on this ? can we get the history working if we use
widgets ( old style Presenter/Views) and not activities ?

>>or maybe create an
>>activity that kinda wraps many other activities:

i think it should be possible and is what is referred to as Composite
Activity in google's documentation.
However I am not sure whether it is considered a good practice.
This concept is briefly mentioned in Google's MVP tutorial
http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html#How_to_navigate

in the very last paragraph, the most important part, which is sadly
left out causing confusiong:

"What about apps with multiple panels in the same window whose state
should all be saved together in a single URL? GWT 2.1 does not attempt
to provide a generic implementation of a composite Place; however,
your app could create a CompositePlace, CompositeActivity, and
CompositePlace.Tokenizer classes that delegate to the constituent
members. In this case, only the composite objects would need to be
registered with your app's ActivityMapper and PlaceHistoryMapper."

do you have any idea on CompositePlace , its relation to Composite
Activity, and how we can map a Composite Place to its corresponding
Activities ?

thank you

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