Add ability to have more than one RequestFactory (issue653802)

1 view
Skip to first unread message

is...@invalidip.com

unread,
Jul 22, 2010, 10:59:10 AM7/22/10
to is...@invalidip.com, google-web-tool...@googlegroups.com, re...@gwt-code-reviews.appspotmail.com
Reviewers: ,

Description:
When more than one RequestFactory is created, we are getting compiling
errors because some of the records are not in the same package than the
actual request factory. To fix this, we simply add all the imports to
the RequestFactoryGenerator in order to know where to find these
records.

Please review this at http://gwt-code-reviews.appspot.com/653802/show

Affected files:
user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java


Index:
user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
===================================================================
---
user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
(revision 8401)
+++
user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
(working copy)
@@ -315,6 +315,12 @@
f.addImport(interfaceType.getQualifiedSourceName());
f.addImport(Record.class.getName());
f.addImport(RecordSchema.class.getName());
+
+ for (JClassType publicRecordType : generatedRecordTypes) {
+ f.addImport(publicRecordType.getPackage().getName() + "." +
publicRecordType.getName());
+ f.addImport(publicRecordType.getPackage().getName() + "." +
publicRecordType.getName() + "Impl");
+ }
+
f.addImplementedInterface(interfaceType.getName());

f.addImplementedInterface(interfaceType.getName());


Ray Ryan

unread,
Jul 22, 2010, 2:01:53 PM7/22/10
to google-web-tool...@googlegroups.com
Thanks for the patch!

We just noticed this ourselves, and a broader patch should soon go in that includes this fix.

Pascal Patry

unread,
Jul 22, 2010, 2:18:19 PM7/22/10
to google-web-tool...@googlegroups.com
On Thursday, July 22, 2010 02:01:53 pm Ray Ryan wrote:
> Thanks for the patch!
>
> We just noticed this ourselves, and a broader patch should soon go in that
> includes this fix.

Great.. are we going to be able to extend a RequestFactory with this
patch? I described the issue there:
http://code.google.com/p/google-web-toolkit/issues/detail?id=5134

We also have the same issues with the Record. We have one common Record
for basic functions that we inherit from others. The problem here is
that the Impl won't implement getters for the inherited types.
http://code.google.com/p/google-web-toolkit/issues/detail?id=5136

We can always work around this by using get(obj.property) instead of the
getters, but EditorSupport really try to use the getters to set the
values in the UI.

Ray Ryan

unread,
Jul 22, 2010, 2:24:19 PM7/22/10
to google-web-tool...@googlegroups.com
Please don't get too attached to EditorSupport. It was a last minute hack without a lot of thought behind it. A ground-up rewrite is in progress. We'll share details soon.

RequestFactory too is undergoing surgery, per https://wave.google.com/wave/waveref/googlewave.com/w+WU4iAICkI 

Not that I want to discourage people from trying this out and giving us feedback! But please understand when we pull the rug out from under you.

pjulien

unread,
Jul 22, 2010, 3:15:37 PM7/22/10
to Google Web Toolkit Contributors
I understand your point about EditorSupport but I still feel one issue
was missed/dismissed in your reply. That is, the fact that we can't
currently inherit records from other records right now because the
getters are not re-generated in the leaf. Is this something that we
can currently consider a bug?

On Jul 22, 2:24 pm, Ray Ryan <rj...@google.com> wrote:
> Please don't get too attached to EditorSupport. It was a last minute hack
> without a lot of thought behind it. A ground-up rewrite is in progress.
> We'll share details soon.
>
> RequestFactory too is undergoing surgery, perhttps://wave.google.com/wave/waveref/googlewave.com/w+WU4iAICkI
>
> Not that I want to discourage people from trying this out and giving us
> feedback! But please understand when we pull the rug out from under you.
>
>
>
> On Thu, Jul 22, 2010 at 11:18 AM, Pascal Patry <i...@invalidip.com> wrote:
> > On Thursday, July 22, 2010 02:01:53 pm Ray Ryan wrote:
> > > Thanks for the patch!
>
> > > We just noticed this ourselves, and a broader patch should soon go in
> > that
> > > includes this fix.
>
> > Great.. are we going to be able to extend a RequestFactory with this
> > patch? I described the issue there:
> >http://code.google.com/p/google-web-toolkit/issues/detail?id=5134
>
> > We also have the same issues with the Record. We have one common Record
> > for basic functions that we inherit from others. The problem here is
> > that the Impl won't implement getters for the inherited types.
> >http://code.google.com/p/google-web-toolkit/issues/detail?id=5136
>
> > We can always work around this by using get(obj.property) instead of the
> > getters, but EditorSupport really try to use the getters to set the
> > values in the UI.
>
> > > On Thu, Jul 22, 2010 at 7:59 AM, <i...@invalidip.com> wrote:
> > > > Reviewers: ,
>
> > > > Description:
> > > > When more than one RequestFactory is created, we are getting compiling
> > > > errors because some of the records are not in the same package than the
> > > > actual request factory. To fix this, we simply add all the imports to
> > > > the RequestFactoryGenerator in order to know where to find these
> > > > records.
>
> > > > Please review this athttp://gwt-code-reviews.appspot.com/653802/show

Ray Ryan

unread,
Jul 26, 2010, 11:53:40 AM7/26/10
to google-web-tool...@googlegroups.com
Yes, that's a flat out bug. Would you mind filing a ticket against Roo, with component GWT? 

Pascal Patry

unread,
Jul 26, 2010, 12:43:24 PM7/26/10
to google-web-tool...@googlegroups.com
On Monday, July 26, 2010 11:53:40 am Ray Ryan wrote:
> Yes, that's a flat out bug. Would you mind filing a ticket against Roo,
> with component GWT?

done..

http://jira.springframework.org/browse/ROO-1139

Reply all
Reply to author
Forward
0 new messages