http://gwt-code-reviews.appspot.com/1062801/diff/1/75
File
user/src/com/google/gwt/requestfactory/server/ReflectiveServiceLayer.java
(right):

http://gwt-code-reviews.appspot.com/1062801/diff/1/75#newcode77
user/src/com/google/gwt/requestfactory/server/ReflectiveServiceLayer.java:77:
return Character.toUpperCase(name.charAt(0))
FYI, java.beans.Introspector from the Sun JDK uses name.substring(0,
1).toUpperCase(Locale.ENGLISH).

And the javadoc for Character.toUpperCase recommends using
String.toUpperCase as well:
http://download.oracle.com/javase/6/docs/api/java/lang/Character.html#toUpperCase(char)

I don't know if it makes a real difference in practice, but just in
case...

http://gwt-code-reviews.appspot.com/1062801/diff/1/78
File
user/src/com/google/gwt/requestfactory/server/RequestFactoryInterfaceValidator.java
(right):

http://gwt-code-reviews.appspot.com/1062801/diff/1/78#newcode947
user/src/com/google/gwt/requestfactory/server/RequestFactoryInterfaceValidator.java:947:
"The domain type %s has more than one proxy type: %s and %s",
Does it mean it's no longer a supported use case? That's something I
recently recommended in the RequestFactory Wave:
https://wave.google.com/wave/waveref/googlewave.com/w+WU4iAICkI/~/conv+root/b+DdsVBvv-A

http://gwt-code-reviews.appspot.com/1062801/diff/1/79
File
user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java
(right):

http://gwt-code-reviews.appspot.com/1062801/diff/1/79#newcode101
user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java:101:
processor = new SimpleRequestProcessor(new ReflectiveServiceLayer());
How about deferring to a third ctor taking an ExceptionHandler and
ServiceLayer as arguments? (so we can use our own implementation if
needed)
  this(exceptionHandler, new ReflectiveServiceLayer());
...
public RequestFactoryServlet(ExceptionHandler exceptionHandler,
ServiceLayer serviceLayer) {
  processor = new SimpleRequestProcessor(serviceLayer);
  processor.setExceptionHandler(exceptionHandler);
}

http://gwt-code-reviews.appspot.com/1062801/diff/1/84
File
user/src/com/google/gwt/requestfactory/server/SimpleRequestProcessor.java
(right):

http://gwt-code-reviews.appspot.com/1062801/diff/1/84#newcode93
user/src/com/google/gwt/requestfactory/server/SimpleRequestProcessor.java:93:
Object loadDomainObject(EntitySource source, Class<?> clazz, String
flatId);
This method should be passed the properties that the client asked for,
so that:
 - with JDO or JPA, you can choose an appropriate/optimized fetch-plan;
and/or generate a JDOQL/Criteria query based on the properties.
 - with something like Morphia+MongoDB, you can ask for the properties
the client wants instead of grabbing the whole object.

The same would apply to the invoke() method.

I do understand this is hard to do well, because it's hard (if ever
possible) to tell whether the operation will actually need the whole
object or not.
So an alternative would be to have something like 2.1.0.M3's
RequestContext back, so the services would have access to the
information if they want it:
https://wave.google.com/wave/waveref/googlewave.com/w+WU4iAICkI/~/conv+root/b+AMnaZSBBA


Actually, it'd be even better if there was an "extension point" (not
really an "extension" at that point but...) to replace the "load entity
then set properties" with a "bulk update"; i.e. if someone wants to go
at a lower level, it could override the method and issue a direct SQL or
MongoDB update request. Or would you recommend "forking" the servlet
code for such things?

http://gwt-code-reviews.appspot.com/1062801/diff/1/84#newcode372
user/src/com/google/gwt/requestfactory/server/SimpleRequestProcessor.java:372:
bean.getTag(Constants.ENCODED_ID_PROPERTY))) {
Shouldn't that be ENCODED_VERSION_PROPERTY?

http://gwt-code-reviews.appspot.com/1062801/diff/1/101
File user/src/com/google/gwt/requestfactory/shared/WriteOperation.java
(right):

http://gwt-code-reviews.appspot.com/1062801/diff/1/101#newcode24
user/src/com/google/gwt/requestfactory/shared/WriteOperation.java:24: *
first time, or encounters a proxy whose version number has changed.
s/version number/version property/
just so it isn't missed when versions will be allowed to be any kind of
value and not only integers ;-)

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

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

Reply via email to