Generally speaking, you do not want to use reflection inside a generator to
try to view the client code.  That's what TypeOracle is for, that's the
supported way of viewing client code.
As for the separate issue of modifying and recompiling a generator itself
while running, you're right in that we don't explicitly support it.  Using
unit tests during generator development as you suggest sounds like a good
strategy to me.  In some cases, you might also get your IDE to do a
hot-replace if you modify the code while debugging, but this can be flaky.

On Wed, Jul 22, 2009 at 6:45 AM, Alen Vrecko <[email protected]> wrote:

>
> Hi,
>
> continuing from
> http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/c65457fa4df351c1
> . Sorry for the added garbage could have known better to post it here
> in the first place.
>
> I see generators as en extension to client code therefore I expect
> them to behave a bit like client code namely refresh recompiles the
> generator and client class code changes are visible to the generator.
>
> As recompiling the generator feature goes maybe it is a bit like
> fairytale i.e. not really needed. Will just write the unit tests for
> generators in any case before running the hosted mode and not play
> with the generator on the fly with change code shutdown-start hosted
> mode repeat.
>
> But seeing the latest class files inside generator is needed for
> refresh to work in some cases. Sure you can do much with TypeOracle
> but you can't instantiate the JType. Afaik there is no bridge between
> a JType and Class type.
>
> What do you think?
>
> Cheers
> Alen
>
> >
>

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

Reply via email to