This issue has come up before: two posts to read about it..

1. Summit Chandel explains the reasons why GWT RPC doesn't accept any
old list of Objects

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3bb11f01a5004cdc/6c81ff6dd7a0f300?lnk=gst&q=Sumit+Chandel+RPC+serializable#6c81ff6dd7a0f300

2. Scott Blum shows a way to get around it (it works, I've tried it)

http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/25d151960b48b5c4

I agree that it isn't a good idea to pass a bag of "any old objects"
over RPC - I've never been tempted to do it, but I hadn't thought that
there is a culture of doing this from other programming environments.
However to do it and all you have to do is specify a set of dummy
fields, one per type you need to pass, in a DTO wrapper class around a
collection and add a very simple custom serializer as Scott explains.

regards
gregor

On Oct 10, 7:29 pm, kozura <[EMAIL PROTECTED]> wrote:
> You can either create an abstract Serializable class, and subclass all
> possible classes that can be sent back, ie List<MySuperClass>, or go
> through the arduous task of creating a custom serializer.  As walden
> mentioned, the former is a much better solution, not only making your
> code cleaner and less error prone, but allowing the GWT compiler to do
> a much better job at optimizing.  If you aren't more specific than
> "Object", the generated RPC serializer has no idea what potential
> objects may get sent through, and so has to include serialization code
> for everything.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to