beans) and emits JSON mapping code handling simple properties, object
graphs and collections."=>
This is very interesting. Can u give some hints as how to go about writing this Generator?
Thanks,
Subhro.
On Tue, Oct 26, 2010 at 10:03 PM, Sebastian Beigel <sebastian@beigel.de> wrote:
Hi Thomas,
> Of course, if your really want Product as a "real" bean, and a List<?>
> instead of a JsArray<?>, you can copy things around (see below); but
> really I believe overlay types are much more readable than anything
> using com.google.gwt.json.* classes.
I used to use overlay type heavily (returning JSON from a Spring
MVC/Jackson backend) and it worked quite well. Although I found it
quite limiting to be unable to model "real" class hierarchies (JSOs
must not be subclassed). I really do this a lot on the server side. I
also really like to use the enhanced for loop for Lists and just do a
new Foo() instead of some tedious Foo.create(). Last but not least I
don't have a "Generate getters/setters" in Eclipse for my JSOs :)
All this led me to write a Generator which inspects my models ("real"
beans) and emits JSON mapping code handling simple properties, object
graphs and collections. That way I can work with real beans and
collections of beans in my (business) code and do the mapping from/to
JSON in my service/DAO layer (still sending/retrieving JSON to/from my
backend).
Sebastian
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment