The place cannot (and shouldn't!) contain anything more than an immutable 
representation of "some state", "some place". As soon as you start having 
several ActivityManagers, you can no longer ask you Place to know which 
Activity should go in which display region.

See, in our app, we have 18 activity mappers! (a bunch of them return 'null' 
except in a couple of cases, to build a "dynamic toolbar"). You might think 
we somehow "abused" them, but even if we try to have as few as possible, 
we'd still have at least 3 of them (one main area, a "north" one and an 
"east" region).
Just recently, we added a new one, and we're in the process of adding yet 
another; that'd give us 20 activitymappers, or 5 of the if you want ot look 
at the "stripped down" potential version.
Clearly, it's not the place's concern to give us the activity (not to 
mention that one place has half a dozen "parameters", and several of them 
condition which activity will be used, with each activity mapper using them 
differently). To give an idea, we have 124 different activity classes, and 
only 10 Place classes or so. Among our 124 activities, 12 of them are for 
the "east" area, and 12 for the "north" area; leaving 100 distinct 
activities for the "main region" (and yes, our activity mappers are hardly 
readable).

Another advantage of separating those concerns is that of "multimodal" 
applications, where the same place means a distinct set of activities 
depending on the device running the app. You can see this in action in the 
"mobilewebapp" sample, which comes in 3 versions (phone, tablet, 
desktop/laptop) mostly by swiping the "shell" (definitions of the screen 
"areas") and activity mappers (and a few activities too, but there's no 
reason some activities couldn't be reused in a few or all "modes"), allowing 
you to share most of the code base.

-- 
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/-/bsNhc85fsD0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to