I canβt say for Place
(although I have a few ideas, see below), but it was discussed for Activity
: https://groups.google.com/d/topic/google-web-toolkit-contributors/V8rhZHiXFRk/discussion
As far as we could go in history, Place
has always been an abstract class in GWT (and FWIW, NOWHERE
place was added long after , note that this commit refers to Wave-mess to disappear from the Internet, where we can see the interface Place
. so it was an interface at some point in time when they were designing the API).
Given that a PlaceHistoryGenerator
(used when you GWT.create()
a PlaceHistoryMapper
) looks at a hierarchy of places, having an abstract class reduces the mass of edge cases!
Imagine that your PlaceHistoryMapper
links are PlaceTokenizers<Foo>
and PlaceTokenizer<Bar>
and you have the class FooBar implements Foo, Bar { }
, which tokenizer should be used? Unless you reference the FooBar
class explicitly in your PlaceHistoryMapper
, the generator will not see it (or, rather, will not look at it), and what code should it generate? And keep in mind that we all want determinism, so the generated code should always be the same. Using a class, the generator can arrange them according to the inheritance tree (from the most specific - from the highest to the least specific) and can safely assume that the 2 places whose classes do not have a special inheritance relationship are completely different, so they can be ( instanceof
in the generated code) in any order and yet provide a stable result β determinism.
Disclaimer: I'm the one who reported the order problem and then provided the patch , but Place
already a class.
source share