GWT 2.1 and Place with token

21 views
Skip to first unread message

Nicolas ANTONIAZZI

unread,
Oct 27, 2010, 3:36:04 AM10/27/10
to google-we...@googlegroups.com
Hello,

I converted all my project to GWT 2.1 Activity/Place following the concept described on http://code.google.com/intl/fr/webtoolkit/doc/trunk/DevGuideMvpActivitiesAndPlaces.html
But, doing this work, I came to a question : Why do we have to set a name in the place constructor ?

A place generate a #ClassName:Token in the url. Would not be easier to just generate a #Token ?

In my opinion it seems a bit complicated to manager class instead of an enum or string constant for each place.
A simplification would be to only have 1 place class with a new token (string) for each place, or severals class but with an empty constructor that initializes its name with a constant.

But I may have not really understood the real advantage of the #PlaceClass:Token, so maybe someone could help me ?

Thanks,

Nicolas

Sebastian Beigel

unread,
Oct 27, 2010, 4:31:57 AM10/27/10
to google-we...@googlegroups.com
Hi Nicolas,

often your places are "parameterized", think of a detail/edit screen
for example that needs the model's id. The token is a generic way to
provide additional information (via the URL) to the place (i.e. the
activity/-ies), i.e. "#editFoo:42".

You can of course re-use one place to dispatch to several activities
based on the token. See the (currently not used) for ProxyPlace and
ProxyListPlace in the Expenses sample for an example.

Sebastian

> --
> 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-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

Nicolas ANTONIAZZI

unread,
Oct 27, 2010, 4:41:19 AM10/27/10
to google-we...@googlegroups.com
Oh, you are absolutly right !
I had not think to this case.

Thanks Sebastian

Nicolas.

2010/10/27 Sebastian Beigel <seba...@beigel.de>
Reply all
Reply to author
Forward
0 new messages