Hi.

The generators are without a doubt a remarkable feature of gwt. But if
you use any reflection on the client classes in the generator you lose
refresh button support. Furthermore while not that major I do find it
annoying that refreshing doesn't recompile the generator code. You
have to stop the hosted mode and start again.

It all boils down to the fact that client code is loaded in
ComplingClassLoader and the Generator is loaded in a different
ClassLoader than that.

Reflection is not that nice. But sometimes one has perfectly
legitimate use cases to use reflection. A good example is Google-Gin.

It came up here 
http://groups.google.com/group/google-gin/browse_thread/thread/d383babb48a287bb
.

Basically gin is instantiating the gin modules which are client code.
If you change the module refresh doesn't work since gin generator is
still seeing the original module loaded and not the recompiled.

I've partially solved the issue (renaming modules doesn't work) by
hacking into the byte[] definitions for the newly created code. Like
this http://pastie.org/553279 .

I guess JavaRebel could be used or something like that. But I'd like
to see a pure gwt solution to this.

I've been thinking in the lines of compiling the generators and
putting the generators in a child of CompilingClassLoader. In that
case using reflection in the generators should get the latest class
definitions. Also changing generator code and pressing refresh would
work.

What do you guys think?

Cheers
Alen
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to