Hello Damien,
That is an uggly problem. Unfortunately I'm not too fluent on
generators, but if you are willing to consider some alternatives there
might be some:
- DeRPC. It's not exactly over-documented, so you might have to do
some searching but it's supposedly a lot faster than RPC while just as
easy to use.
- JSON
- XML. I mention it here because it is designed for hierarchical
structures like trees, and you can incrementally parse it
- Return a string that contains some representation of your data and
parse it on your own
On Dec 19, 9:43 am, Damien Picard <
picard.dam...@gmail.com> wrote:
> Hi,
>
> In a few words, I've got a problem with big object deserialization after an
> RPC call.
> On Internet Explorer, the browser ask me to interrupt the script because the
> deserialization process is too long.
>
> In fact, my RPC service returns a deep recursive tree, and some other data,
> where the Item is called Option :
>
> The generated FieldSerializer looks like :
>
> public static void
> deserialize(com.google.gwt.user.client.rpc.SerializationStreamReader
> streamReader, Option instance) throws
> com.google.gwt.user.client.rpc.SerializationException{
> //The childs of this Option node, defining the tree
> * setChildren(instance, (java.util.List) streamReader.readObject());*
> * //Some other atomic data
> (...)*
>
> }
>
> In my mind, the invocation of setChildren() involves that the childs Options
> are deserialized too. And, because of my tree is too deep, this
> deserialization process leeds to have a "Would you like to interrupt the
> script ?" in IE6/7.
>
> I think I could resolve this problem by adding a deferred command in this
> process :
>
> public static void
> deserialize(com.google.gwt.user.client.rpc.SerializationStreamReader
> streamReader, Option instance) throws
> com.google.gwt.user.client.rpc.SerializationException{
> //The childs of this Option node, defining the tree
> Command c = new Command(){
> * public void execute(){
> setChildren(instance, (java.util.List)
> streamReader.readObject());*
> }
> }
> DeferredCommand.addPause();
> DeferredCommand.addCommand(c);
> * //Some other atomic data
> (...)*
>
> }
>
> But, to do that, I have to modify the generator of this serializer, and i've
> not found where I can do that. So my questions are :
>
> - Is it a good idea ?
> - How can I modify /implement my own serializer generator for this tree ?