gabrial11392 / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

Clean-up ProxyGenerator#generate() #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The ProxyGenerator#generate() is a mess right now. It should be refactored 
into a bunch of small private methods.

Original Issue:
http://code.google.com/p/puzzlebazar/issues/detail?id=80

Original issue reported on code.google.com by philippe.beaudoin on 27 Mar 2010 at 5:58

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 7 Apr 2010 at 5:17

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 9 Apr 2010 at 6:08

GoogleCodeExporter commented 9 years ago
Philippe, are you working on this issue?

I'm thinking about splitting ProxyGenerator to several classes. Something like 
one per feature (place, tabs, gatekeeper). The generator instantiate one 
instance of each and relies on them to generator code. They will act as method 
writer into the resulting class or maybe block writer into one method. I need 
to fully read 1000+ lines of code ;)...

Original comment by olivier....@free.fr on 20 Jul 2010 at 8:28

GoogleCodeExporter commented 9 years ago
I'd love this! I haven't been around to cleaning this... It kind of grew out of 
hand and I couldn't see a nice clean way of organizing the code back in the 
days... But please do it.

I wonder, though, before we attempt such a major refactoring, should we try to 
build unit tests for the various code generation paths? Is this difficult to 
do? (We probably need GwtTestCase...)

Original comment by philippe.beaudoin on 20 Jul 2010 at 8:39

GoogleCodeExporter commented 9 years ago
I've never find a good way to unit test my generators. It's missing something 
with GWT to do it (some mock).

My plan is first to split ProxyGenerator into small methods using eclipse 
"extract method" function. This will not change anything about generated code. 
But it will change many for me ;).

Of course having unit tests for all code generator paths is the best way. But I 
not sure to be able to do all.

This issue may be a big work but I think we need to do it before adding new 
code.

Original comment by olivier....@free.fr on 20 Jul 2010 at 9:02

GoogleCodeExporter commented 9 years ago
I agree, it grew out of hands. And if we want to tackle Issue 69 it will help 
if we already have a clean example implementation of generators.

I have tried to test a lot of the various generation code paths in the example 
apps, and my production app here is another large test, so there may be enough 
tests for us not to worry about unit testing prior to refactoring... I'll trust 
your judgement on this one.

Original comment by philippe.beaudoin on 20 Jul 2010 at 9:08

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 22 Sep 2010 at 1:35

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 22 Mar 2011 at 6:39

GoogleCodeExporter commented 9 years ago
This was done a while back, pretty clean now, not sure why it wasn't closed...

Original comment by philippe.beaudoin on 20 May 2011 at 4:23