Validating RPC Serialization at Compile Time?

63 views
Skip to first unread message

Joseph Lust

unread,
Sep 14, 2012, 11:06:15 AM9/14/12
to google-we...@googlegroups.com
A number of times we've run into serialization exceptions with GWT-RPC. Of course following the serialization policies for GWT-RPC to the letter can prevent this, but not all of our devs are keen on these.

Since the compiler sees every RPC async interface, and is compiling those objects passed via the interface, is it possible to detect RPC serialization issues at compile time rather than runtime when it is first used? Seems like the compiler should be able to do this but I've not been able to find a setting for it. That would save folks time and make using GWT-RPC less error prone. Heck, adding it to the GWT Eclipse Plugin for automated error checking would be even more useful.

Thanks for any tips or tricks you may be able to provide. :)



Sincerely,
Joseph

RyanZA

unread,
Sep 15, 2012, 10:34:48 AM9/15/12
to google-we...@googlegroups.com
Better way to handle this would be great.. 

Obvious response to this is "have unit tests to check if gwt-rpc works for each class". This gives a problem in complex object graphs with multiple descendants where some are meant to be used over gwt-rpc and some aren't, etc.

Having the compiler check every RPC async interface also isn't the right answer because of inheritance and other issues.

We should really have an annotation, something like '@GWT-Entity' perhaps, that could be tagged onto a class to mark it for use in GWT-RPC and would be validated by the compiler to make sure it is usable over gwt-rpc. It can be fully optional too, so classes without @GWT-Entity could still be serialized but generate a warning to tell the user the class hasn't been marked. So then it would be fully backwards compatible.

RyanZA

unread,
Sep 18, 2012, 3:51:26 PM9/18/12
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages