1- My GWT client communicates with the Server side using RPC.
Sometimes the serialized (Bean) object contains a little amount of
data for example, say a String[] of 5 positions or a hasmap of 5
values etc. I am thinking to create a json string of these values and
transmit it to the server side, because, I believe this could save me
from creating a Hashmap or any other type of object to be created on
the client side. Am I thinking in the right direction?
2- I have seen a couple of json libs for the gwt like GWT-Jsonizer and
Rocket-GWT etc. These libs allows to create a json from a
corresponding java object. For example,
I have a Form or different fields. On pressing a submit, it creates
the java bean object from the Form values which is then used by one of
the above API's to get the corresponding json string. The original
bean object still lives on the client. Similarly a huge GWT app with
create a lot number of Beans consuming browser memory. I am thinking
to approach this problem by creating a one of my own json converter
that would possibly keep adding a new json string to the existing json
string and return me the final json once I call the create method. For
example
JsonConverter jsonConverter = new jsonConverter();
jsonConverter.addJson(String key, String[] arrValues) // { "key" :
["arrValues[0]","arrValues[n-1]"]
jsonConverter.addJson(String key, String value) // , "key" : , "value"
String createJson() // can return the whole json String { "key" :
["arrValues[0]","arrValues[n-1]"] , "key" : , "value" }
Similarly more operations can be added to it, e.g where a key can
further take a map of key/value pairs etc.
Am I thinking in the right direction?
Any ideas/suggestion would be highly appreciable.
Thanks a lot.
--
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.