On 2011/01/11 22:13:48, Konstantin.Scheglov wrote:

   In reality, as I can see from patch, there are no UiBinder specific
check,
just design-time check. But probably would be good to add UiBinder
specific
check to avoid unnecessary rebinding other classes.


Yes, but the design-time check is specific to given generator domain
(e.g. UiBinder or other gui builder related things)....This doesn't
belong inside of StandardRebindOracle....


   To support UiBinder at design time we generate new Impl class for
same
UiBinder interface each time when user changes ui.xml template. We
don't
re-create ClassLoader, so use cache.


Which cache are you talking about in this case?



3, 4 and 5. Yes, it is not quite correct implementation, hack for
UiBinder. But
until generators will be able to decide what to put to cache and what
not, we
need somehow support UiBinder designing. So, can we add this hack,
mark it as
such and revise once we will have support better approach?

It sounds like you need to re-run a generator within the same
StandardRebindOracle (which is not really related to what happens for
generator result caching in the dev mode refresh case)....So I don't
think it would be constructive to go ahead with this approach as a
temporary stop-gap (since it's not clear when it would be no longer
needed)....

Some alternate approaches:

1.  Create a fresh StandardRebindOracle (which will have an empty
typeNameBindingMap?), when you know you are in a situation where you
require all generators to run fresh.

2.  Add an invalidate method to StandardRebindOracle, which allows you
to invalidate an entry in the typeNameBindingMap

3.  Add an overloaded rebind method to StandardRebindOracle which
includes flag indicating whether it should be overwritable, which would
indicate that it should always overwrite, regardless of whether it has
already run within the same rebind oracle.....

e.g.:


public String rebind(TreeLogger logger, String typeName,
      ArtifactAcceptor artifactAcceptor, boolean overWritable) throws
UnableToCompleteException {

    ....

    if (!overWritable) {
       typeNameBindingMap.put(typeName, resultTypeName);
    }
   ....
}

Probable some slightly better naming possible there....

Jason

http://gwt-code-reviews.appspot.com/1275801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to