http://gwt-code-reviews.appspot.com/1601806/diff/45014/user/test/com/google/web/bindery/requestfactory/server/SimpleBar.java
File
user/test/com/google/web/bindery/requestfactory/server/SimpleBar.java
(right):

http://gwt-code-reviews.appspot.com/1601806/diff/45014/user/test/com/google/web/bindery/requestfactory/server/SimpleBar.java#newcode95
user/test/com/google/web/bindery/requestfactory/server/SimpleBar.java:95:
public static SimpleBar returnFirst(List<SimpleBar> list) {
On 2012/05/24 01:29:55, skybrian wrote:
On 2012/05/24 00:28:11, tbroyer wrote:
> On 2012/05/23 18:05:24, skybrian wrote:
> > It's weird that this method isn't just inlined.
>
> It can be called from the client-side, it's a "service method"
> (SimpleBarRequest).

Oh, I see.

(Off topic rant.) This is just test code, but I'm annoyed that I have
to search
the codebase for interfaces annotated with @Service or @ServiceName
that point
to this class in order to tell whether a method I'm looking at is
directly
called over the Internet or not. That's pretty dangerous. There needs
to be some
kind of annotation cluing the reader in that this is an RPC endpoint.

This is what the RF ValidationTool is for ;-)
It will detect methods in the RequestContext (and properties in proxies)
that have no equivalent in the server code.
If you configure it as an annotation processor in Eclipse, it will
directly mark those methods in the editor.
See
http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation

This will still mark your shared interfaces though, not your server
code.
I'm not dismissing the issue, but I think it's up to developers to have
rules if they want some documentation (JavaDoc or custom annotation).

I think GWT-RPC did a better job here, because the class extends
RemoteServiceServlet and implements the service interface.

And people asked how to expose their existing services without the need
to create RemoteServiceServlet "proxies" ;-)

RF is more similar to Axis2 exposing POJOs as WS:
http://axis.apache.org/axis2/java/core/docs/pojoguide.html (I'm sure
there are other tools –notably in Spring– that expose POJOs as RESTful,
JSON-RPC, XML-RPC or SOAP services without the POJO knowing about it; I
haven't found them back right now)

http://gwt-code-reviews.appspot.com/1601806/diff/45014/user/test/com/google/web/bindery/requestfactory/shared/impl/RequestPayloadTest.java
File
user/test/com/google/web/bindery/requestfactory/shared/impl/RequestPayloadTest.java
(right):

http://gwt-code-reviews.appspot.com/1601806/diff/45014/user/test/com/google/web/bindery/requestfactory/shared/impl/RequestPayloadTest.java#newcode117
user/test/com/google/web/bindery/requestfactory/shared/impl/RequestPayloadTest.java:117:
SimpleProxyId<?> id = (SimpleProxyId<?>) foo.stableId();
On 2012/05/24 01:29:55, skybrian wrote:
On 2012/05/24 00:28:11, tbroyer wrote:
> I could add a flag or counter in the 'if's and then check their
values after
the
> loops to assert this code has been reached?

Sure, I think that's good. Increment a counter and assert that it's >=
1 after
the for loop. (If it drops to zero due to a code change and that's
intentional,
we have some dead code to delete.)

Done.

http://gwt-code-reviews.appspot.com/1601806/

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

Reply via email to