Re: Activities & Places, token question
[+Cc GWT Group]
On Fri, Nov 25, 2011 at 3:38 PM, SurfMan <nlsurfman@hotmail.com> wrote:
> Sorry to wake up an old thread, but after struggling with an empty
> place/token I ended up here too...
>
> I just don't understand why "#blah" would end up as the default place
> "" with token "blah", and why it's not place "blah" with an empty/null
> token. What is the reasoning behind this?
The serialization and deserialization processes have to be symmetric.
So if you allow an empty prefix and choose to serialize {prefix="",
token="foo"} as #foo (rather than #:foo), then you have to parse #foo
as {prefix="", token="foo"} (rather than {prefix="foo", token=""}).
The current choice is more flexible than the alternative, as it allows
the PlaceTokenizer for the empty prefix to create any kind of Place
depending on the token (if that's what you want), and falling back to
'null' for unknown tokens.
With the alternate design, the generated PlaceHistoryMapper would then
look for a PlaceTokenizer for the prefix "foo" and won't find any so
it'd fall back to the default place, always, without any hook for you
to customize this behavior).
--
Thomas Broyer
/tɔ.ma.bʁwa.je/
--
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home