Re: GWT1.6 RPC service with List in return: Serialization pb

Tue, 14 Apr 2009 17:32:47 -0700

GWT needs to know ALL the types that CAN be serialized to the UI at
compile time. It looks at the RPC parameters and return types,
traces their roots and possible sub-classes, and makes sure the proper
serializers/deserializers are present.

First tho, I ask, what good is a List<Object> ???  Say this worked...
what would you do with the List in the UI?

Second, ONLY Serializable types can be used with RPC, so the Minimum
that makes ANY sense is List<Serializable>. This may work, but the
compiler would then take a large amount of time finding ALL
Serializable classes... bad.

Still, you can then get almost anything in your List... so what do you
do in the client??? Iterate and check instanceof on each item???

IF I had to do this, I would create a "marker interface",

public interface DTO extends Serializable
{
}

and make any class that could be used in the UI implement DTO. the
make it List<DTO>

the compiler would then only generate serializers for anything marked
DTO, and be much more efficient.

STILL, On the client you don't know exactly what you have in the List,
and any solution to that problem will
be slow and error prone.




--~--~---------~--~----~------------~-------~--~----~
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